Fix #775, The oldest open bug, and it only took me 5 mins
This commit is contained in:
parent
708ccc758a
commit
a4a4042eb1
1 changed files with 12 additions and 1 deletions
|
@ -33,6 +33,7 @@ import reborncore.common.registration.RebornRegistry;
|
||||||
import reborncore.common.registration.impl.ConfigRegistry;
|
import reborncore.common.registration.impl.ConfigRegistry;
|
||||||
import reborncore.common.util.FluidUtils;
|
import reborncore.common.util.FluidUtils;
|
||||||
import techreborn.api.generator.EFluidGenerator;
|
import techreborn.api.generator.EFluidGenerator;
|
||||||
|
import techreborn.blocks.generator.BlockThermalGenerator;
|
||||||
import techreborn.client.container.IContainerProvider;
|
import techreborn.client.container.IContainerProvider;
|
||||||
import techreborn.client.container.builder.BuiltContainer;
|
import techreborn.client.container.builder.BuiltContainer;
|
||||||
import techreborn.client.container.builder.ContainerBuilder;
|
import techreborn.client.container.builder.ContainerBuilder;
|
||||||
|
@ -60,11 +61,14 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon
|
||||||
return new ItemStack(ModBlocks.THERMAL_GENERATOR, 1);
|
return new ItemStack(ModBlocks.THERMAL_GENERATOR, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOn = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
|
||||||
if (!this.world.isRemote) {
|
if (!this.world.isRemote) {
|
||||||
|
boolean didRun = false;
|
||||||
if (this.acceptFluid() && FluidUtils.drainContainers(this.tank, this.inventory, 0, 1))
|
if (this.acceptFluid() && FluidUtils.drainContainers(this.tank, this.inventory, 0, 1))
|
||||||
this.syncWithAll();
|
this.syncWithAll();
|
||||||
for (final EnumFacing direction : EnumFacing.values()) {
|
for (final EnumFacing direction : EnumFacing.values()) {
|
||||||
|
@ -73,9 +77,16 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon
|
||||||
this.getPos().getY() + direction.getFrontOffsetY(),
|
this.getPos().getY() + direction.getFrontOffsetY(),
|
||||||
this.getPos().getZ() + direction.getFrontOffsetZ()))
|
this.getPos().getZ() + direction.getFrontOffsetZ()))
|
||||||
.getBlock() == Blocks.LAVA) {
|
.getBlock() == Blocks.LAVA) {
|
||||||
if (this.tryAddingEnergy(1))
|
if (this.tryAddingEnergy(1)){
|
||||||
this.lastOutput = this.world.getTotalWorldTime();
|
this.lastOutput = this.world.getTotalWorldTime();
|
||||||
|
didRun = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(didRun != isOn){
|
||||||
|
isOn = didRun;
|
||||||
|
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockThermalGenerator.ACTIVE, isOn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue