more glitch fix

This commit is contained in:
khj xiaogu 2021-12-03 15:25:21 +08:00
parent 198126052f
commit 58a3c6b846
No known key found for this signature in database
GPG key ID: DEA172814EAFF426

View file

@ -68,8 +68,7 @@ public abstract class SteamEngineTileEntity extends EngineTileEntity implements
super.tick();
if (level != null && !level.isClientSide) {
BlockState state = this.level.getBlockState(this.worldPosition);
if (!tank.isEmpty()) {
if (tank.drain(this.getSteamConsumptionPerTick(), IFluidHandler.FluidAction.EXECUTE).getAmount() >= this.getSteamConsumptionPerTick()) {
if (!tank.isEmpty()&&tank.drain(this.getSteamConsumptionPerTick(), IFluidHandler.FluidAction.EXECUTE).getAmount() >= this.getSteamConsumptionPerTick()) {
this.level.setBlockAndUpdate(this.worldPosition, state.setValue(SteamEngineBlock.LIT, true));
if(heatup>=20) {
this.appliedCapacity = this.getGeneratingCapacity();
@ -77,8 +76,7 @@ public abstract class SteamEngineTileEntity extends EngineTileEntity implements
this.refreshWheelSpeed();
}else
heatup++;
}
} else {
}else {
if(heatup>0)
heatup--;
this.level.setBlockAndUpdate(this.worldPosition, state.setValue(SteamEngineBlock.LIT, false));