mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-10-25 20:22:26 +00:00
Adds configurable display of backpack fullness (#101)
This commit is contained in:
1 parent
bf94b22345
commit
1552ad1b68
3 files changed
+18
No files matched your search
@@ -137,6 +137,7 @@ public class Config {
|
||||
public static boolean enableHints = true;
|
||||
public static final LinkedListMultimap<String, String> hints = LinkedListMultimap.create();
|
||||
public static boolean enableEnergyStat = true;
|
||||
public static boolean showBackpackDurability = true;
|
||||
|
||||
public static boolean isStructureEnabled(String uid) {
|
||||
return !Config.disabledStructures.contains(uid);
|
||||
@@ -301,6 +302,9 @@ public class Config {
|
||||
configCommon.moveProperty("tweaks.gui", "mail.alert", "tweaks.gui.mail.alert");
|
||||
configCommon.renameProperty("tweaks.gui.mail.alert", "mail.alert", "enabled");
|
||||
|
||||
showBackpackDurability = configCommon
|
||||
.getBooleanLocalized("tweaks.gui", "showBackpackDurability", showBackpackDurability);
|
||||
|
||||
mailAlertEnabled = configCommon.getBooleanLocalized("tweaks.gui.mail.alert", "enabled", mailAlertEnabled);
|
||||
mailAlertXPosition = configCommon.getEnumLocalized(
|
||||
"tweaks.gui.mail.alert",
|
||||
|
||||
@@ -348,4 +348,17 @@ public class ItemBackpack extends ItemWithGui {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(final ItemStack stack) {
|
||||
final int occupied = ItemInventory.getOccupiedSlotCount(stack);
|
||||
final int max = getBackpackSize();
|
||||
|
||||
return 1.0d - (occupied + 1.0d) / (max + 1.0d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(final ItemStack stack) {
|
||||
return Config.showBackpackDurability && ItemInventory.getOccupiedSlotCount(stack) > 0;
|
||||
}
|
||||
}
|
||||
@@ -1781,6 +1781,7 @@ for.config.crafting.stamps.disabled.comment=Disables the crafting recipe for cer
|
||||
|
||||
for.config.tweaks=Tweaks
|
||||
|
||||
for.config.tweaks.gui.showBackpackDurability=Shows a durability bar on backpacks indicating how full they are.
|
||||
for.config.tweaks.gui.mail.alert.enabled=Mail Alert
|
||||
for.config.tweaks.gui.mail.alert.enabled.comment=Enables the new mail alert box.
|
||||
for.config.tweaks.gui.mail.alert.xPosition=Horizontal Position
|
||||
|
||||
Reference in new issue
Block a user