Fix farm crashing when IO config is pressed

This commit is contained in:
tterrag1098 committed 2014-12-17 18:58:37 -05:00
1 parent b9fd4c1a19
commit 4841edb8d7
2 files changed
+11 -5

No files matched your search

@@ -137,6 +137,7 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate implements I
return super.colorMultiplier(world, x, y, z);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item arg0, CreativeTabs arg1, List items) {
@@ -49,12 +49,14 @@ public class GuiFarmStation extends GuiPoweredMachineBase {
@Override
protected void drawForegroundImpl(int mouseX, int mouseY) {
super.drawForegroundImpl(mouseX, mouseY);
if(inventorySlots.inventorySlots.size() >= farm.maxSupSlot && !isConfigOverlayEnabled()) {
for (int i : farm.lockedSlots) {
Slot slot = inventorySlots.getSlot(i);
GL11.glEnable(GL11.GL_BLEND);
RenderUtil.renderQuad2D(slot.xDisplayPosition, slot.yDisplayPosition, 0, 16, 16, new Vector4f(0, 0, 0, 0.5));
if (i < inventorySlots.inventorySlots.size()) { // hack to allow old broken farms to be opened
Slot slot = inventorySlots.getSlot(i);
GL11.glEnable(GL11.GL_BLEND);
RenderUtil.renderQuad2D(slot.xDisplayPosition, slot.yDisplayPosition, 0, 16, 16, new Vector4f(0, 0, 0, 0.5));
}
}
}
}
@@ -83,7 +85,10 @@ public class GuiFarmStation extends GuiPoweredMachineBase {
@Override
protected void actionPerformed(GuiButton b) {
farm.toggleLockedState(b.id);
if (b instanceof ToggleButtonEIO) {
farm.toggleLockedState(b.id);
}
super.actionPerformed(b);
}
@Override