Fix GUI glitch with the Alveary (no progress bar)

This commit is contained in:
mezz committed 2015-06-07 21:09:20 -07:00
1 parent 2e4d9856b2
commit d183abfd11
3 files changed
+12 -5

No files matched your search

@@ -146,6 +146,10 @@ public abstract class TileAlveary extends TileForestry implements IAlvearyCompon
if (getInternalInventory() instanceof FakeInventoryAdapter) {
createInventory();
}
if (worldObj != null && !worldObj.isRemote) {
setNeedsNetworkUpdate();
}
}
@Override
@@ -358,7 +358,7 @@ public class TileAlvearyPlain extends TileAlveary implements ISidedInventory, IB
@Override
public ItemStack decrStackSize(int slotIndex, int amount) {
ItemStack itemStack = super.decrStackSize(slotIndex, amount);
if (isMaster() && slotIndex == SLOT_QUEEN) {
if (slotIndex == SLOT_QUEEN) {
handleQueenChange();
}
return itemStack;
@@ -367,15 +367,18 @@ public class TileAlvearyPlain extends TileAlveary implements ISidedInventory, IB
@Override
public void setInventorySlotContents(int slotIndex, ItemStack itemStack) {
super.setInventorySlotContents(slotIndex, itemStack);
if (isMaster() && slotIndex == SLOT_QUEEN) {
if (slotIndex == SLOT_QUEEN) {
handleQueenChange();
}
}
private void handleQueenChange() {
if (!Proxies.common.isSimulating(worldObj)) {
ItemStack itemStack = getStackInSlot(SLOT_QUEEN);
displayQueen = BeeManager.beeRoot.getMember(itemStack);
TileAlvearyPlain master = (TileAlvearyPlain) getCentralTE();
if (master != null) {
ItemStack itemStack = getStackInSlot(SLOT_QUEEN);
master.displayQueen = BeeManager.beeRoot.getMember(itemStack);
}
}
}
@@ -182,7 +182,7 @@ public abstract class TileFarm extends TileForestry implements IFarmComponent {
this.isMaster = true;
if (worldObj != null && !worldObj.isRemote) {
sendNetworkUpdate();
setNeedsNetworkUpdate();
}
}