From 2a57de320575e730fb5ae41e4b46c9e54ffcdc96 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:05:37 +0100 Subject: [PATCH] Bug Fixes - Fixed basin not triggering a recipe check when output fluids are emptied - Fluid behaviour safety on render thread - Wrenchable Depots --- .../contraptions/fluids/FluidTransportBehaviour.java | 3 +++ .../content/contraptions/processing/BasinTileEntity.java | 7 +++++-- .../create/content/logistics/block/depot/DepotBlock.java | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTransportBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTransportBehaviour.java index 2e76257ff..69a132d81 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTransportBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTransportBehaviour.java @@ -58,6 +58,9 @@ public abstract class FluidTransportBehaviour extends TileEntityBehaviour { World world = getWorld(); BlockPos pos = getPos(); boolean onClient = world.isRemote; + + if (interfaces == null) + return; Collection connections = interfaces.values(); // Do not provide a lone pipe connection with its own flow input diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java index 0f37c2939..1909ccb51 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java @@ -118,7 +118,9 @@ public class BasinTileEntity extends SmartTileEntity { inputTank = new SmartFluidTankBehaviour(SmartFluidTankBehaviour.INPUT, this, 2, 1000, true) .whenFluidUpdates(() -> contentsChanged = true); - outputTank = new SmartFluidTankBehaviour(SmartFluidTankBehaviour.OUTPUT, this, 2, 1000, true).forbidInsertion(); + outputTank = new SmartFluidTankBehaviour(SmartFluidTankBehaviour.OUTPUT, this, 2, 1000, true) + .whenFluidUpdates(() -> contentsChanged = true) + .forbidInsertion(); behaviours.add(inputTank); behaviours.add(outputTank); @@ -250,7 +252,8 @@ public class BasinTileEntity extends SmartTileEntity { newFacing = test; } - if (preferredSpoutput != null && BasinBlock.canOutputTo(world, pos, preferredSpoutput) && preferredSpoutput != Direction.UP) + if (preferredSpoutput != null && BasinBlock.canOutputTo(world, pos, preferredSpoutput) + && preferredSpoutput != Direction.UP) newFacing = preferredSpoutput; if (newFacing != currentFacing) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java index afbf8dab9..e86919e81 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotBlock.java @@ -6,6 +6,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack; +import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; @@ -34,7 +35,7 @@ import net.minecraftforge.items.ItemStackHandler; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -public class DepotBlock extends Block implements ITE { +public class DepotBlock extends Block implements ITE, IWrenchable { public DepotBlock(Properties p_i48440_1_) { super(p_i48440_1_);