diff --git a/resources/assets/storagedrawers/lang/en_US.lang b/resources/assets/storagedrawers/lang/en_US.lang index 1342d2a..7cec3c0 100644 --- a/resources/assets/storagedrawers/lang/en_US.lang +++ b/resources/assets/storagedrawers/lang/en_US.lang @@ -154,6 +154,8 @@ storageDrawers.config.prop.enableDebugLogging=Enable Debug Logging storageDrawers.config.prop.enableDebugLogging.tooltip=Prints extra information to the logs. storageDrawers.config.prop.enableTape=Enable Tape storageDrawers.config.prop.enableTape.tooltip=For moving drawers with contents. +storageDrawers.config.prop.wailaStackRemainder=WAILA amount presentation +storageDrawers.config.prop.wailaStackRemainder.tooltip=How item amounts are displayed by WAILA. storageDrawers.config.addons=Addons storageDrawers.config.addons.tooltip=Configure global addon pack settings. diff --git a/src/com/jaquadro/minecraft/storagedrawers/config/ConfigManager.java b/src/com/jaquadro/minecraft/storagedrawers/config/ConfigManager.java index d175540..80be4b1 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/config/ConfigManager.java +++ b/src/com/jaquadro/minecraft/storagedrawers/config/ConfigManager.java @@ -76,6 +76,7 @@ public class ConfigManager public boolean enableFallbackRecipes; public boolean invertShift; public boolean debugTrace; + public boolean stackRemainderWaila; public int level2Mult; public int level3Mult; @@ -234,6 +235,7 @@ public class ConfigManager cache.enableSidedOutput = config.get(Configuration.CATEGORY_GENERAL, "enableSidedOutput", true).setLanguageKey(LANG_PREFIX + "prop.enableSidedOutput").getBoolean(); cache.enableItemConversion = config.get(Configuration.CATEGORY_GENERAL, "enableItemConversion", true).setLanguageKey(LANG_PREFIX + "prop.enableItemConversion").getBoolean(); cache.enableFallbackRecipes = config.get(Configuration.CATEGORY_GENERAL, "enableFallbackRecipes", true).setLanguageKey(LANG_PREFIX + "prop.enableFallbackRecipes").setRequiresMcRestart(true).getBoolean(); + cache.stackRemainderWaila = !config.get(Configuration.CATEGORY_GENERAL, "wailaStackRemainder", "exact", null, new String[]{"exact", "stack + remainder"}).setLanguageKey(LANG_PREFIX + "prop.wailaStackRemainder").getString().equals("exact"); cache.invertShift = config.get(Configuration.CATEGORY_GENERAL, "invertShift", false, "Inverts how shift works with drawers. If this is true, shifting will only give one item, where regular clicks will give a full stack. Leave false for default behavior.") .setLanguageKey(LANG_PREFIX + "prop.invertShift").getBoolean(); diff --git a/src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java b/src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java index 03de8d5..0939914 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java +++ b/src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java @@ -78,6 +78,16 @@ public class Waila extends IntegrationModule if (drawer instanceof IFractionalDrawer && ((IFractionalDrawer) drawer).getConversionRate() > 1) name = stackName + ((i == 0) ? " [" : " [+") + ((IFractionalDrawer) drawer).getStoredItemRemainder() + "]"; + else if (StorageDrawers.config.cache.stackRemainderWaila) { + int stacks = drawer.getStoredItemCount() / drawer.getStoredItemStackSize(); + int remainder = drawer.getStoredItemCount() - (stacks * drawer.getStoredItemStackSize()); + if (stacks > 0 && remainder > 0) + name = stackName + " [" + stacks + "x" + drawer.getStoredItemStackSize() + " + " + remainder + "]"; + else if (stacks > 0) + name = stackName + " [" + stacks + "x" + drawer.getStoredItemStackSize() + "]"; + else + name = stackName + " [" + remainder + "]"; + } else name = stackName + " [" + drawer.getStoredItemCount() + "]"; }