mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-19 19:59:58 +00:00
Merge pull request #2338 from HenryLoenwind/cleanup
Cleanup: null checks in doUpdate()
This commit is contained in:
commit
bfa86203aa
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) {
|
||||
updateEntityClient();
|
||||
return;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -107,7 +107,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,10 +91,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