Optional Slots...

This commit is contained in:
AlgorithmX2 2013-12-29 23:56:08 -06:00
parent 26724d5ab8
commit bc335ac5d6
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package appeng.container.slot;
public interface IOptionalSlotHost
{
boolean isSlotEnabled(int idx, OptionalSlotFake osf);
}

View File

@ -0,0 +1,29 @@
package appeng.container.slot;
import net.minecraft.inventory.IInventory;
public class OptionalSlotFake extends SlotFake
{
int invSlot;
final int groupNum;
IOptionalSlotHost host;
int srcX;
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 );
srcX = x;
srcY = y;
invSlot = idx;
this.groupNum = groupNum;
}
@Override
public boolean isEnabled()
{
return host.isSlotEnabled( groupNum, this );
}
}