Skip to content

Commit

Permalink
Default quantity visibility option
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Jan 15, 2018
1 parent 3ef0d98 commit 7201074
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/assets/storagedrawers/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ storagedrawers.config.prop.controllerRange=Controller Range
storagedrawers.config.prop.controllerRange.tooltip=Range for detecting networked blocks.
storagedrawers.config.prop.enableFramedDrawers=Enable Framed Drawers
storagedrawers.config.prop.enableFramedDrawers.tooltip=Drawers with custom materials.
storagedrawers.config.prop.defaultQuantify=Quantity Visible by Default
storagedrawers.config.prop.defaultQuantify.tooltip=Drawers display quantity numbers when placed.

storagedrawers.config.addons=Addons
storagedrawers.config.addons.tooltip=Configure global addon pack settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class ConfigCache {
public boolean debugTrace;
public boolean stackRemainderWaila;
public boolean registerExtraCompRules;
public boolean defaultQuantify;
public String[] compRules;
public String[] oreWhitelist;
public String[] oreBlacklist;
Expand Down Expand Up @@ -154,6 +155,7 @@ public void syncConfig () {
cache.debugTrace = config.get(Configuration.CATEGORY_GENERAL, "enableDebugLogging", false,
"Writes additional log messages while using the mod. Mainly for debug purposes. Should be kept disabled unless instructed otherwise.")
.setLanguageKey(LANG_PREFIX + "prop.enableDebugLogging").getBoolean();
cache.defaultQuantify = config.get(Configuration.CATEGORY_GENERAL, "defaultQuantify", false).setLanguageKey(LANG_PREFIX + "prop.defaultQuantify").getBoolean();

//cache.enableAE2Integration = config.get(sectionIntegration.getQualifiedName(), "enableAE2", true).setLanguageKey(LANG_PREFIX + "integration.enableAE2").setRequiresMcRestart(true).getBoolean();
cache.enableWailaIntegration = config.get(sectionIntegration.getQualifiedName(), "enableWaila", true).setLanguageKey(LANG_PREFIX + "integration.enableWaila").setRequiresMcRestart(true).getBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.api.storage.EnumBasicDrawer;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerAttributes;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerAttributesModifiable;
import com.jaquadro.minecraft.storagedrawers.block.BlockStandardDrawers;
import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawers;
import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawersStandard;
Expand Down Expand Up @@ -56,6 +58,12 @@ public boolean placeBlockAt (@Nonnull ItemStack stack, EntityPlayer player, Worl

tile.setIsSealed(false);
}

if (StorageDrawers.config.cache.defaultQuantify) {
IDrawerAttributes attributes = tile.getDrawerAttributes();
if (attributes instanceof IDrawerAttributesModifiable)
((IDrawerAttributesModifiable) attributes).setIsShowingQuantity(true);
}
}

return true;
Expand Down

0 comments on commit 7201074

Please sign in to comment.