show upgrade information in Stirling generator GUI when the upgrade slot is empty

This commit is contained in:
Matthias Mann committed 2015-01-17 10:33:48 +01:00
1 parent 2f98cba0eb
commit 5e1d82e0e9
4 files changed
+56 -4

No files matched your search

@@ -21,13 +21,15 @@ public abstract class AbstractMachineContainer extends Container {
protected Map<Slot, Point> playerSlotLocations = new HashMap<Slot, Point>();
protected Slot upgradeSlot;
public AbstractMachineContainer(InventoryPlayer playerInv, AbstractMachineEntity te) {
this.tileEntity = te;
addMachineSlots(playerInv);
if(te.getSlotDefinition().getNumUpgradeSlots() == 1) {
addSlotToContainer(new Slot(te, te.getSlotDefinition().getMinUpgradeSlot(), getUpgradeOffset().x, getUpgradeOffset().y) {
upgradeSlot = new Slot(te, te.getSlotDefinition().getMinUpgradeSlot(), getUpgradeOffset().x, getUpgradeOffset().y) {
@Override
public int getSlotStackLimit() {
@@ -38,7 +40,8 @@ public abstract class AbstractMachineContainer extends Container {
public boolean isItemValid(ItemStack itemStack) {
return tileEntity.isItemValidForSlot(tileEntity.getSlotDefinition().getMinUpgradeSlot(), itemStack);
}
});
};
addSlotToContainer(upgradeSlot);
}
int x = getPlayerInventoryOffset().x;
@@ -77,6 +80,10 @@ public abstract class AbstractMachineContainer extends Container {
return new Point(12,60);
}
public Slot getUpgradeSlot() {
return upgradeSlot;
}
public AbstractMachineEntity getTileEntity() {
return tileEntity;
}