From b1041e19d6270cf6deb3b848aea828e4e4652d37 Mon Sep 17 00:00:00 2001 From: CovertJaguar <CovertJaguar@gmail.com> Date: Sat, 29 Jun 2013 03:22:55 -0700 Subject: [PATCH] Some minor bits --- common/buildcraft/api/power/PowerProvider.java | 3 +-- common/buildcraft/energy/TileEngineLegacy.java | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/api/power/PowerProvider.java b/common/buildcraft/api/power/PowerProvider.java index b8cbfa8d..ccbec7e9 100644 --- a/common/buildcraft/api/power/PowerProvider.java +++ b/common/buildcraft/api/power/PowerProvider.java @@ -227,8 +227,7 @@ public final class PowerProvider { if (boundsCheck) { if (quantity < minEnergyReceived) { quantity = minEnergyReceived; - } - if (quantity > maxEnergyReceived) { + } else if (quantity > maxEnergyReceived) { quantity = maxEnergyReceived; } } diff --git a/common/buildcraft/energy/TileEngineLegacy.java b/common/buildcraft/energy/TileEngineLegacy.java index f25aa5c7..7882e768 100644 --- a/common/buildcraft/energy/TileEngineLegacy.java +++ b/common/buildcraft/energy/TileEngineLegacy.java @@ -30,9 +30,11 @@ public class TileEngineLegacy extends TileEngine { public void updateEntity() { worldObj.removeBlockTileEntity(xCoord, yCoord, zCoord); TileEntity newTile = worldObj.getBlockTileEntity(xCoord, yCoord, zCoord); - newTile.readFromNBT(nbt); - sendNetworkUpdate(); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if (newTile instanceof TileEngine) { + newTile.readFromNBT(nbt); + sendNetworkUpdate(); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } } @Override