Fixed issues when day/night cycle disabled.

This commit is contained in:
CrazyPants committed 2014-06-10 15:15:27 +08:00
1 parent a924e35d39
commit b4e64657e4
8 files changed
+15 -15

No files matched your search

@@ -85,7 +85,7 @@ public abstract class AbstractTankConduit extends AbstractLiquidConduit {
} else if(player.getCurrentEquippedItem().getItem() == Items.bucket) {
if(!getBundle().getEntity().getWorldObj().isRemote) {
long curTick = getBundle().getEntity().getWorldObj().getWorldTime();
long curTick = getBundle().getEntity().getWorldObj().getTotalWorldTime();
if(curTick - lastEmptyTick < 20) {
numEmptyEvents++;
} else {
@@ -21,7 +21,7 @@ public class MagnetController implements IEntitySelector {
ActiveMagnet mag = getActiveMagnet(event.player);
if(mag != null) {
doHoover(event.player);
if(event.side == Side.SERVER && event.player.worldObj.getWorldTime() % 20 == 0) {
if(event.side == Side.SERVER && event.player.worldObj.getTotalWorldTime() % 20 == 0) {
ItemMagnet.drainPerSecondPower(mag.item);
event.player.inventory.setInventorySlotContents(mag.slot, mag.item);
event.player.inventory.markDirty();
@@ -371,7 +371,7 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
if(slotDefinition.getNumOutputSlots() <= 0) {
return false;
}
if(worldObj.getWorldTime() % 20 != 0) {
if(worldObj.getTotalWorldTime() % 20 != 0) {
return false;
}
@@ -402,7 +402,7 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
if(slotDefinition.getNumInputSlots() <= 0) {
return false;
}
if(worldObj.getWorldTime() % 20 != 0) {
if(worldObj.getTotalWorldTime() % 20 != 0) {
return false;
}
@@ -207,7 +207,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*implements IEnt
if(!redstoneCheckPassed || !hasPower()) {
return false;
}
if(worldObj.getWorldTime() % 2 != 0) {
if(worldObj.getTotalWorldTime() % 2 != 0) {
return false;
}
@@ -148,7 +148,7 @@ public class TileEntityStirlingGenerator extends AbstractMachineEntity implement
storedEnergy += (ENERGY_PER_TICK * getEnergyMultiplier());
}
burnTime--;
sendBurnTimePacket = worldObj.getWorldTime() % 20 == 1 || burnTime == 0;
sendBurnTimePacket = worldObj.getTotalWorldTime() % 20 == 1 || burnTime == 0;
}
transmitEnergy();
@@ -212,8 +212,8 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
}
if(!isContoller()) {
if(notifyNeighbours) {
worldObj.notifyBlockOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
if(notifyNeighbours) {
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
notifyNeighbours = false;
}
return;
@@ -221,8 +221,8 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
chargeItems();
boolean hasSignal = isRecievingRedstoneSignal();
boolean hasSignal = isRecievingRedstoneSignal();
if(inputControlMode == RedstoneControlMode.IGNORE) {
inputEnabled = true;
} else if(inputControlMode == RedstoneControlMode.NEVER) {
@@ -256,8 +256,8 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
PacketHandler.sendToAllAround(new PacketPowerStorage(this), this, 64);
}
if(notifyNeighbours) {
worldObj.notifyBlockOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
if(notifyNeighbours) {
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
notifyNeighbours = false;
}
@@ -173,7 +173,7 @@ public class TileVat extends AbstractPoweredTaskEntity implements IFluidHandler
@Override
protected boolean processTasks(boolean redstoneChecksPassed) {
boolean res = super.processTasks(redstoneChecksPassed);
if(tanksDirty && worldObj.getWorldTime() % 10 == 0) {
if(tanksDirty && worldObj.getTotalWorldTime() % 10 == 0) {
PacketHandler.sendToAllAround(new PacketTanks(this), this);
tanksDirty = false;
}
@@ -212,7 +212,7 @@ public class TileTank extends AbstractMachineEntity implements IFluidHandler {
tankDirty = false;
return true;
}
if(tankDirty && worldObj.getWorldTime() % 10 == 0) {
if(tankDirty && worldObj.getTotalWorldTime() % 10 == 0) {
PacketHandler.sendToAllAround(new PacketTank(this), this);
tankDirty = false;
}
@@ -223,7 +223,7 @@ public class TileTank extends AbstractMachineEntity implements IFluidHandler {
if(!redstoneCheckPassed) {
return false;
}
if(worldObj.getWorldTime() % 20 != 0) {
if(worldObj.getTotalWorldTime() % 20 != 0) {
return false;
}
return drainFullContainer() || fillEmptyContainer();