effects
This commit is contained in:
parent
1bad392760
commit
b3427dec54
|
@ -81,7 +81,7 @@ public abstract class BoilerBlock extends Block implements ILiquidContainer {
|
|||
TileEntity te = p_180655_2_.getBlockEntity(p_180655_3_);
|
||||
if (te instanceof BoilerTileEntity) {
|
||||
BoilerTileEntity boiler = (BoilerTileEntity) te;
|
||||
if (boiler.output.getFluidAmount()>=10000) {//steam leaking
|
||||
if (boiler.output.getFluidAmount()>=10000&&boiler.lastheat!=0) {//steam leaking
|
||||
double d0 = p_180655_3_.getX();
|
||||
double d1 = p_180655_3_.getY() + 1;
|
||||
double d2 = p_180655_3_.getZ();
|
||||
|
|
|
@ -149,17 +149,26 @@ public abstract class BoilerTileEntity extends TileEntity implements IHeatReceiv
|
|||
|
||||
@Override
|
||||
public void tick() {
|
||||
lastheat=heatreceived;
|
||||
|
||||
|
||||
//debug
|
||||
if (this.level != null && !this.level.isClientSide&&heatreceived!=0) {
|
||||
int consume = Math.min(getHUPerTick(), heatreceived);
|
||||
heatreceived = 0;
|
||||
double waterconsume=(SPConfig.COMMON.steamPerWater.get()*10);
|
||||
consume = Math.min((int)(this.input.drain((int) Math.ceil(consume / waterconsume), FluidAction.EXECUTE).getAmount() * waterconsume), consume);
|
||||
this.output.fill(new FluidStack(FluidRegistry.steam.get().getFluid(), consume / 10), FluidAction.EXECUTE);
|
||||
|
||||
this.level.sendBlockUpdated(this.getBlockPos(),this.getBlockState(),this.getBlockState(), 3);
|
||||
this.setChanged();
|
||||
if (this.level != null && !this.level.isClientSide) {
|
||||
boolean flag=false;
|
||||
if(lastheat!=heatreceived)
|
||||
flag=true;
|
||||
lastheat=heatreceived;
|
||||
if(heatreceived!=0) {
|
||||
int consume = Math.min(getHUPerTick(), heatreceived);
|
||||
heatreceived = 0;
|
||||
double waterconsume=(SPConfig.COMMON.steamPerWater.get()*10);
|
||||
consume = Math.min((int)(this.input.drain((int) Math.ceil(consume / waterconsume), FluidAction.EXECUTE).getAmount() * waterconsume), consume);
|
||||
this.output.fill(new FluidStack(FluidRegistry.steam.get().getFluid(), consume / 10), FluidAction.EXECUTE);
|
||||
flag=true;
|
||||
}
|
||||
if(flag) {
|
||||
this.setChanged();
|
||||
this.level.sendBlockUpdated(this.getBlockPos(),this.getBlockState(),this.getBlockState(), 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue