Apply same-style trim to hide upgrade border; added capacity line to WAILA; changed default WAILA item counts to 'JABBA' style

This commit is contained in:
Justin Aquadro committed 2016-01-15 02:09:09 -05:00
1 parent 0409437358
commit f217dd6c99
9 files changed
+43 -7

No files matched your search

@@ -92,6 +92,7 @@ storageDrawers.controllerSlave.description=Extra attach points for controllers
storageDrawers.waila.empty=<Empty>
storageDrawers.waila.level=Upgrade Level: %s
storageDrawers.waila.drawer=#%s: %s
storageDrawers.waila.limit=Stack Limit: %s (x%s)
storageDrawers.waila.locked=Locked
storageDrawers.waila.void=Void
storageDrawers.waila.sorting=Sorting
@@ -54,7 +54,7 @@ public class BlockCompDrawers extends BlockDrawers implements INetworked
}
@Override
protected BlockType retrimType () {
public BlockType retrimType () {
return null;
}
@@ -143,10 +143,16 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
if (newBlock == null)
return false;
TileEntityDrawers tile = getTileEntity(world, x, y, z);
if (newBlock == this && newMeta == world.getBlockMetadata(x, y, z) && !tile.shouldHideUpgrades()) {
tile.setShouldHideUpgrades(true);
return true;
}
if (newBlock == this)
world.setBlockMetadataWithNotify(x, y, z, newMeta, 3);
else {
TileEntity tile = world.getTileEntity(x, y, z);
TileEntity newDrawer = createNewTileEntity(world, newMeta);
NBTTagCompound tag = new NBTTagCompound();
@@ -163,7 +169,7 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
return true;
}
protected BlockType retrimType () {
public BlockType retrimType () {
return BlockType.Drawers;
}
@@ -46,6 +46,7 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
private int drawerCapacity = 1;
private boolean shrouded = false;
private boolean taped = false;
private boolean hideUpgrade = false;
private EnumSet<LockAttribute> lockAttributes = null;
@@ -240,6 +241,19 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
}
}
public boolean shouldHideUpgrades () {
return hideUpgrade;
}
public void setShouldHideUpgrades (boolean hide) {
hideUpgrade = hide;
if (worldObj != null && !worldObj.isRemote) {
markDirty();
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
public boolean isSealed () {
if (!StorageDrawers.config.cache.enableTape)
return false;
@@ -462,6 +476,10 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
if (tag.hasKey("Shr"))
shrouded = tag.getBoolean("Shr");
hideUpgrade = false;
if (tag.hasKey("HideUp"))
hideUpgrade = tag.getBoolean("HideUp");
NBTTagList slots = tag.getTagList("Slots", Constants.NBT.TAG_COMPOUND);
drawers = new IDrawer[slots.tagCount()];
@@ -499,6 +517,9 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
if (shrouded)
tag.setBoolean("Shr", shrouded);
if (hideUpgrade)
tag.setBoolean("HideUp", hideUpgrade);
NBTTagList slots = new NBTTagList();
for (IDrawer drawer : drawers) {
NBTTagCompound slot = new NBTTagCompound();
@@ -115,7 +115,7 @@ public class DrawersRenderer implements ISimpleBlockRenderingHandler
renderer.uvRotateTop = 0;
int maxStorageLevel = tile.getMaxStorageLevel();
if (maxStorageLevel > 1 && StorageDrawers.config.cache.renderStorageUpgrades) {
if (maxStorageLevel > 1 && StorageDrawers.config.cache.renderStorageUpgrades && !tile.shouldHideUpgrades()) {
for (int i = 0; i < 6; i++)
boxRenderer.setExteriorIcon(block.getOverlayIcon(world, x, y, z, i, maxStorageLevel), i);
@@ -239,7 +239,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.stackRemainderWaila = !config.get(Configuration.CATEGORY_GENERAL, "wailaStackRemainder", "stack + remainder", 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();
@@ -96,6 +96,9 @@ public class Waila extends IntegrationModule
currenttip.add(StatCollector.translateToLocalFormatted("storageDrawers.waila.drawer", i + 1, name));
}
int limit = tile.getDrawerCapacity() * tile.getEffectiveStorageMultiplier();
currenttip.add(StatCollector.translateToLocalFormatted("storageDrawers.waila.limit", limit, tile.getEffectiveStorageMultiplier()));
String attrib = "";
if (tile.isLocked(LockAttribute.LOCK_POPULATED))
attrib += (attrib.isEmpty() ? "" : ", ") + StatCollector.translateToLocal("storageDrawers.waila.locked");
@@ -56,7 +56,7 @@ public class BlockSortingDrawers extends BlockDrawers
}
@Override
protected BlockType retrimType () {
public BlockType retrimType () {
return BlockType.DrawersSorting;
}
@@ -1,5 +1,6 @@
package com.jaquadro.minecraft.storagedrawers.item;
import com.jaquadro.minecraft.storagedrawers.block.BlockDrawers;
import net.minecraft.block.Block;
import net.minecraft.block.BlockWood;
import net.minecraft.entity.player.EntityPlayer;
@@ -18,6 +19,10 @@ public class ItemTrim extends ItemMultiTexture
@Override
public boolean doesSneakBypassUse (World world, int x, int y, int z, EntityPlayer player) {
return true;
Block block = world.getBlock(x, y, z);
if (block instanceof BlockDrawers && ((BlockDrawers) block).retrimType() != null)
return true;
return false;
}
}