mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-27 23:45:55 +00:00
Cleanup: null checks in doUpdate()
They are not needed, the code calling doUpdate() would NPE if worldObj was ever null at this point.
This commit is contained in:
1 parent
5923e62950
commit
30ac16d829
11 files changed
+7
-26
No files matched your search
@@ -222,10 +222,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(worldObj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (IConduit conduit : conduits) {
|
||||
conduit.updateEntity(worldObj);
|
||||
}
|
||||
|
||||
@@ -233,10 +233,6 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(worldObj == null) { // sanity check
|
||||
return;
|
||||
}
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
// check if the block on the client needs to update its texture
|
||||
if(isActive() != lastActive) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity
|
||||
|
||||
super.doUpdate();
|
||||
|
||||
if(worldObj == null || worldObj.isRemote) { // sanity check
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
boolean powerChanged = (lastSyncPowerStored != storedEnergyRF && shouldDoWorkThisTick(5));
|
||||
|
||||
@@ -240,9 +240,6 @@ public class TileHyperCube extends TileEntityEio implements IInternalPowerHandle
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(worldObj == null) { // sanity check
|
||||
return;
|
||||
}
|
||||
if(worldObj.isRemote) {
|
||||
return;
|
||||
} // else is server, do all logic only on the server
|
||||
|
||||
@@ -104,7 +104,7 @@ public class TileKillerJoe extends AbstractMachineEntity implements IFluidHandle
|
||||
public void doUpdate() {
|
||||
updateArmSwingProgress();
|
||||
hooverXP();
|
||||
if(worldObj != null && !worldObj.isRemote) {
|
||||
if (!worldObj.isRemote) {
|
||||
getAttackera().onUpdate();
|
||||
if(inventory[0] != null != hadSword) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
@@ -196,10 +196,6 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerHa
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(worldObj == null) { // sanity check
|
||||
return;
|
||||
}
|
||||
|
||||
if(blockMetadata == -1) {
|
||||
isCreative = getBlockMetadata() == 1;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class TileReservoir extends TileEntityEio implements IFluidHandler, ITank
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(worldObj == null || worldObj.isRemote) {
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(worldObj == null || worldObj.isRemote) {
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
collectEnergy();
|
||||
|
||||
@@ -96,7 +96,7 @@ public class TileTransceiver extends AbstractPoweredTaskEntity implements IFluid
|
||||
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
if(!registered && worldObj != null && !worldObj.isRemote) {
|
||||
if (!registered && !worldObj.isRemote) {
|
||||
ServerChannelRegister.instance.register(this);
|
||||
registered = true;
|
||||
removeUnregsiteredChannels(sendChannels);
|
||||
@@ -104,7 +104,7 @@ public class TileTransceiver extends AbstractPoweredTaskEntity implements IFluid
|
||||
}
|
||||
super.doUpdate();
|
||||
|
||||
if(worldObj != null && !worldObj.isRemote) {
|
||||
if (!worldObj.isRemote) {
|
||||
railController.doTick();
|
||||
if(sendChannelsDirty) {
|
||||
PacketHandler.sendToAllAround(new PacketSendRecieveChannelList(this, true), this, 256);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class TileWirelessCharger extends TileEntityEio implements IInternalPower
|
||||
@Override
|
||||
public void doUpdate() {
|
||||
|
||||
if(worldObj == null || worldObj.isRemote) {
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,10 +89,6 @@ public class TileTelePad extends TileTravelAnchor implements IInternalPowerRecei
|
||||
master.breakNetwork();
|
||||
}
|
||||
|
||||
if (worldObj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(autoUpdate) {
|
||||
updateConnectedState(true);
|
||||
autoUpdate = false;
|
||||
|
||||
Reference in new issue
Block a user