Fix fluid replication in fluid replicator. Closes #2352

This commit is contained in:
drcrazy 2021-03-01 17:19:16 +00:00 committed by modmuss50
parent 96383ebaaf
commit bca4d88fd9

View file

@ -26,6 +26,7 @@ package techreborn.blockentity.machine.multiblock;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.Fluids;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
@ -82,6 +83,10 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
if (!world.isClient && ticksSinceLastChange >= 10) {
if (!inventory.getStack(1).isEmpty()) {
FluidUtils.fillContainers(tank, inventory, 1, 2);
if (tank.isEmpty()){
// need to set to empty fluid due to #2352
tank.setFluid(Fluids.EMPTY);
}
}
ticksSinceLastChange = 0;
}