mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-23 13:39:51 +00:00
show upgrade information in Stirling generator GUI when the upgrade slot is empty
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user