mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-23 21:49:39 +00:00
Finished adding void upgrade; re-added WAILA attribute strings
This commit is contained in:
1 parent
6a9ca57be5
commit
5a9dcc3e9e
9 files changed
+56
-2
No files matched your search
@@ -64,6 +64,7 @@ storageDrawers.waila.empty=<Empty>
|
||||
storageDrawers.waila.level=Upgrade Level: %s
|
||||
storageDrawers.waila.drawer=#%s: %s
|
||||
storageDrawers.waila.locked=Locked
|
||||
storageDrawers.waila.void=Void
|
||||
|
||||
# Configuration
|
||||
storageDrawers.config.title=Storage Drawers Configuration
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 470 B |
@@ -90,6 +90,8 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconLock;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconVoid;
|
||||
|
||||
public BlockDrawers (String blockName, int drawerCount, boolean halfDepth) {
|
||||
this(Material.wood, blockName, drawerCount, halfDepth);
|
||||
@@ -587,6 +589,11 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
||||
return iconLock;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getVoidIcon () {
|
||||
return iconVoid;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons (IIconRegister register) {
|
||||
@@ -636,6 +643,7 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
||||
iconIndicator4[1] = register.registerIcon(StorageDrawers.MOD_ID + ":indicator/indicator_4_on");
|
||||
|
||||
iconLock = register.registerIcon(StorageDrawers.MOD_ID + ":indicator/lock_icon");
|
||||
iconVoid = register.registerIcon(StorageDrawers.MOD_ID + ":indicator/void_icon");
|
||||
|
||||
loadBlockConfig();
|
||||
}
|
||||
|
||||
@@ -426,6 +426,10 @@ public class TileEntityDrawersComp extends TileEntityDrawers
|
||||
int oldCount = pooledCount;
|
||||
pooledCount = (pooledCount % convRate[slot]) + convRate[slot] * amount;
|
||||
|
||||
int poolMax = getMaxCapacity(0) * convRate[0];
|
||||
if (pooledCount > poolMax)
|
||||
pooledCount = poolMax;
|
||||
|
||||
if (pooledCount != oldCount) {
|
||||
if (pooledCount != 0 || isLocked())
|
||||
markAmountDirty();
|
||||
@@ -474,6 +478,14 @@ public class TileEntityDrawersComp extends TileEntityDrawers
|
||||
return protoStack[slot].getItem().getItemStackLimit(protoStack[slot]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCapacityForInventoryStack (int slot) {
|
||||
if (isVoid())
|
||||
return Integer.MAX_VALUE;
|
||||
else
|
||||
return getMaxCapacity(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT (int slot, NBTTagCompound tag) {
|
||||
ItemStack protoStack = getStoredItemPrototype(slot);
|
||||
|
||||
@@ -96,6 +96,8 @@ public class DrawersRenderer implements ISimpleBlockRenderingHandler
|
||||
renderIndicator(block, x, y, z, side, renderer, tile.getStatusLevel());
|
||||
if (StorageDrawers.config.cache.enableLockUpgrades)
|
||||
renderLock(block, x, y, z, side, renderer, tile.isLocked());
|
||||
if (StorageDrawers.config.cache.enableVoidUpgrades)
|
||||
renderVoid(block, x, y, z, side, renderer, tile.isVoid());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -113,6 +115,19 @@ public class DrawersRenderer implements ISimpleBlockRenderingHandler
|
||||
RenderHelper.instance.state.clearRotateTransform();
|
||||
}
|
||||
|
||||
private void renderVoid (BlockDrawers block, int x, int y, int z, int side, RenderBlocks renderer, boolean voided) {
|
||||
if (!voided)
|
||||
return;
|
||||
|
||||
double depth = block.halfDepth ? .5 : 1;
|
||||
IIcon iconVoid = block.getVoidIcon();
|
||||
|
||||
RenderHelper.instance.setRenderBounds(1 - .0625, 0.9375, 0, 1, 1, depth + .005);
|
||||
RenderHelper.instance.state.setRotateTransform(RenderHelper.ZPOS, side);
|
||||
RenderHelper.instance.renderPartialFace(RenderHelper.ZPOS, x, y, z, iconVoid, 0, 0, 1, 1);
|
||||
RenderHelper.instance.state.clearRotateTransform();
|
||||
}
|
||||
|
||||
private static final int[] cut = new int[] {
|
||||
ModularBoxRenderer.CUT_YPOS | ModularBoxRenderer.CUT_YNEG | ModularBoxRenderer.CUT_XPOS | ModularBoxRenderer.CUT_XNEG | ModularBoxRenderer.CUT_ZPOS,
|
||||
ModularBoxRenderer.CUT_YPOS | ModularBoxRenderer.CUT_YNEG | ModularBoxRenderer.CUT_XPOS | ModularBoxRenderer.CUT_XNEG | ModularBoxRenderer.CUT_ZNEG,
|
||||
|
||||
@@ -81,5 +81,10 @@ public class ModRecipes
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeLock), "xy ", " y ", " z ",
|
||||
'x', Items.gold_nugget, 'y', Items.gold_ingot, 'z', ModItems.upgradeTemplate);
|
||||
}
|
||||
|
||||
if (config.cache.enableVoidUpgrades) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeVoid), "yyy", "xzx", "yyy",
|
||||
'x', Blocks.obsidian, 'y', Items.stick, 'z', ModItems.upgradeTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,8 +78,14 @@ public class Waila extends IntegrationModule
|
||||
currenttip.add(StatCollector.translateToLocalFormatted("storageDrawers.waila.drawer", i + 1, name));
|
||||
}
|
||||
|
||||
//if (tile.isLocked())
|
||||
// currenttip.add(StatCollector.translateToLocal("storageDrawers.waila.locked"));
|
||||
String attrib = "";
|
||||
if (tile.isLocked())
|
||||
attrib += (attrib.isEmpty() ? "" : ", ") + StatCollector.translateToLocal("storageDrawers.waila.locked");
|
||||
if (tile.isVoid())
|
||||
attrib += (attrib.isEmpty() ? "" : ", ") + StatCollector.translateToLocal("storageDrawers.waila.void");
|
||||
|
||||
if (!attrib.isEmpty())
|
||||
currenttip.add(attrib);
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,11 @@ public class CompDrawerData extends BaseDrawerData
|
||||
return central.getStoredItemStackSize(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemCapacityForInventoryStack () {
|
||||
return central.getItemCapacityForInventoryStack(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canItemBeStored (ItemStack itemPrototype) {
|
||||
if (getStoredItemPrototype() == null)
|
||||
|
||||
@@ -21,6 +21,8 @@ public interface ICentralInventory
|
||||
|
||||
public int getStoredItemStackSize (int slot);
|
||||
|
||||
public int getItemCapacityForInventoryStack (int slot);
|
||||
|
||||
public void readFromNBT (int slot, NBTTagCompound tag);
|
||||
|
||||
public void writeToNBT (int slot, NBTTagCompound tag);
|
||||
|
||||
Reference in new issue
Block a user