diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankConnectivityHandler.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankConnectivityHandler.java index 0c0c8f6ef..39b694816 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankConnectivityHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankConnectivityHandler.java @@ -199,7 +199,7 @@ public class FluidTankConnectivityHandler { if (simulate) return amount; - + boolean opaque = false; for (int yOffset = 0; yOffset < height; yOffset++) { @@ -234,7 +234,7 @@ public class FluidTankConnectivityHandler { } } } - + te.setWindows(!opaque); return amount; @@ -281,7 +281,7 @@ public class FluidTankConnectivityHandler { if (!toDistribute.isEmpty() && tankAt != te) { FluidStack copy = toDistribute.copy(); FluidTank tankInventory = tankAt.tankInventory; - if (tankInventory.isEmpty() && tankInventory instanceof CreativeSmartFluidTank) + if (tankInventory.isEmpty() && tankInventory instanceof CreativeSmartFluidTank) ((CreativeSmartFluidTank) tankInventory).setContainedFluid(toDistribute); else { int split = Math.min(maxCapacity, toDistribute.getAmount()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankRenderer.java index 2818b3a6f..c3d51df67 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankRenderer.java @@ -25,7 +25,7 @@ public class FluidTankRenderer extends SafeTileEntityRenderer tileEntityTypeIn) { super(tileEntityTypeIn); @@ -114,6 +115,8 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI public void initialize() { super.initialize(); sendData(); + if (world.isRemote) + updateRenderBoundingBox(); } private void onPositionChanged() { @@ -286,18 +289,20 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI return isController() ? pos : controller; } - private AxisAlignedBB cachedBoundingBox; + public void updateRenderBoundingBox() { + if (isController()) + renderBoundingBox = super.getRenderBoundingBox().expand(width - 1, height - 1, width - 1); + else + renderBoundingBox = super.getRenderBoundingBox(); + } @Override @OnlyIn(Dist.CLIENT) public AxisAlignedBB getRenderBoundingBox() { - if (cachedBoundingBox == null) { - if (isController()) - cachedBoundingBox = super.getRenderBoundingBox().expand(width - 1, height - 1, width - 1); - else - cachedBoundingBox = super.getRenderBoundingBox(); + if (renderBoundingBox == null) { + renderBoundingBox = super.getRenderBoundingBox(); } - return cachedBoundingBox; + return renderBoundingBox; } @Override @@ -367,6 +372,7 @@ public class FluidTankTileEntity extends SmartTileEntity implements IHaveGoggleI world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 16); if (isController()) tankInventory.setCapacity(getCapacityMultiplier() * getTotalTankSize()); + updateRenderBoundingBox(); } if (isController()) { float fillState = getFillState(); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java index bee1a0f3e..b242a38f3 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java @@ -8,13 +8,11 @@ import java.util.function.Consumer; import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; - import com.simibubi.create.foundation.utility.IPartialSafeNBT; import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.ITickableTileEntity; -import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.fluids.capability.CapabilityFluidHandler;