Gui/Container over haul to get Bus Guis working.
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user