Gui/Container over haul to get Bus Guis working.

This commit is contained in:
AlgorithmX2
2014-01-01 02:57:16 -06:00
parent 2a4e4c0369
commit 6b37ef8847
10 changed files with 241 additions and 99 deletions
+19 -2
View File
@@ -1,6 +1,7 @@
package appeng.container.slot;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class OptionalSlotFake extends SlotFake
{
@@ -9,8 +10,8 @@ public class OptionalSlotFake extends SlotFake
final int groupNum;
IOptionalSlotHost host;
int srcX;
int srcY;
public int srcX;
public int srcY;
public OptionalSlotFake(IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum) {
super( inv, idx, x + offX * 18, y + offY * 18 );
@@ -18,11 +19,27 @@ public class OptionalSlotFake extends SlotFake
srcY = y;
invSlot = idx;
this.groupNum = groupNum;
host = containerBus;
}
@Override
public ItemStack getStack()
{
if ( !isEnabled() )
{
if ( getDisplayStack() != null )
clearStack();
}
return super.getStack();
}
@Override
public boolean isEnabled()
{
if ( host == null )
return false;
return host.isSlotEnabled( groupNum, this );
}