Update old tank syncing code, fixes TechReborn/TechReborn/issues/1377

This commit is contained in:
modmuss50 2018-01-20 16:16:56 +00:00
parent e4736447bd
commit 677fa7765c
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
2 changed files with 6 additions and 2 deletions

View file

@ -114,7 +114,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro
this.ticksSinceLastChange++; this.ticksSinceLastChange++;
// Check cells input slot 2 time per second // Check cells input slot 2 time per second
if (this.ticksSinceLastChange >= 10) { if (!world.isRemote && this.ticksSinceLastChange >= 10) {
if (!this.inventory.getStackInSlot(1).isEmpty()) { if (!this.inventory.getStackInSlot(1).isEmpty()) {
FluidUtils.drainContainers(this.tank, this.inventory, 1, 6); FluidUtils.drainContainers(this.tank, this.inventory, 1, 6);
FluidUtils.fillContainers(this.tank, this.inventory, 1, 6, this.tank.getFluidType()); FluidUtils.fillContainers(this.tank, this.inventory, 1, 6, this.tank.getFluidType());
@ -125,6 +125,8 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro
if (!world.isRemote && this.getMutliBlock()) { if (!world.isRemote && this.getMutliBlock()) {
this.charge(7); this.charge(7);
} }
tank.compareAndUpdate();
} }
@Override @Override

View file

@ -119,7 +119,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IToolDro
this.ticksSinceLastChange++; this.ticksSinceLastChange++;
// Check cells input slot 2 time per second // Check cells input slot 2 time per second
if (this.ticksSinceLastChange >= 10) { if (!world.isRemote && this.ticksSinceLastChange >= 10) {
if (!this.inventory.getStackInSlot(1).isEmpty()) { if (!this.inventory.getStackInSlot(1).isEmpty()) {
FluidUtils.drainContainers(this.tank, this.inventory, 1, 5); FluidUtils.drainContainers(this.tank, this.inventory, 1, 5);
FluidUtils.fillContainers(this.tank, this.inventory, 1, 5, this.tank.getFluidType()); FluidUtils.fillContainers(this.tank, this.inventory, 1, 5, this.tank.getFluidType());
@ -130,6 +130,8 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IToolDro
if (!world.isRemote && this.getMutliBlock()) { if (!world.isRemote && this.getMutliBlock()) {
this.charge(6); this.charge(6);
} }
tank.compareAndUpdate();
} }
@Override @Override