diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java index 7ff7153ae..fad0ba50c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java @@ -29,6 +29,8 @@ public class CrafterCTBehaviour extends ConnectedTextureBehaviour { if (input1 == null || input2 == null) return false; + if (input1.data.isEmpty() || input2.data.isEmpty()) + return false; if (pos.add(input1.data.get(0)) .equals(otherPos.add(input2.data.get(0)))) return true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java index a438ccd31..7a5a457fc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java @@ -17,7 +17,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; @@ -27,6 +27,7 @@ public class MillstoneTileEntity extends KineticTileEntity { public ItemStackHandler inputInv; public ItemStackHandler outputInv; + public LazyOptional capability; public int timer; private MillingRecipe lastRecipe; @@ -34,6 +35,7 @@ public class MillstoneTileEntity extends KineticTileEntity { super(type); inputInv = new ItemStackHandler(1); outputInv = new ItemStackHandler(9); + capability = LazyOptional.of(MillstoneInventoryHandler::new); } @Override @@ -81,6 +83,12 @@ public class MillstoneTileEntity extends KineticTileEntity { sendData(); } + @Override + public void remove() { + super.remove(); + capability.invalidate(); + } + private void process() { RecipeWrapper inventoryIn = new RecipeWrapper(inputInv); @@ -138,9 +146,8 @@ public class MillstoneTileEntity extends KineticTileEntity { @Override public LazyOptional getCapability(Capability cap, Direction side) { - if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) - return LazyOptional.of(MillstoneInventoryHandler::new) - .cast(); + if (isItemHandlerCap(cap)) + return capability.cast(); return super.getCapability(cap, side); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/capability/CapabilityMinecartController.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/capability/CapabilityMinecartController.java index cf3b5abe2..715b4c1e2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/capability/CapabilityMinecartController.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/capability/CapabilityMinecartController.java @@ -99,6 +99,13 @@ public class CapabilityMinecartController implements ICapabilitySerializable capability = cart.getCapability(MINECART_CONTROLLER_CAPABILITY); 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 b2898e0d7..90ce7d1c0 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 @@ -435,7 +435,7 @@ public class BasinTileEntity extends SmartTileEntity { if (targetInv == null && !outputItems.isEmpty()) return false; for (ItemStack itemStack : outputItems) { - if (simulate) { + if (simulate || direction == Direction.DOWN) { if (!ItemHandlerHelper.insertItemStacked(targetInv, itemStack.copy(), simulate) .isEmpty()) return false; diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java index 81f54ab1c..c422b9699 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java @@ -120,6 +120,8 @@ public class BlazeBurnerTileEntity extends SmartTileEntity { return false; if (newFuel.ordinal() < activeFuel.ordinal()) return false; + if (activeFuel == FuelType.SPECIAL && remainingBurnTime > 20) + return false; if (newFuel == activeFuel) { if (remainingBurnTime + newBurnTime > maxHeatCapacity && !forceOverflow) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java index e0ae67f56..a1b96f488 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java @@ -414,6 +414,8 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { for (Direction direction : Iterate.horizontalDirections) { if (direction == movementFacing && below.getSpeed() == 0) continue; + if (direction == movementFacing.getOpposite()) + continue; if (tunnelTE.flaps.containsKey(direction) || tunnelTE.hasValidOutputFunnel(direction)) { BlockPos offset = tunnelTE.pos.down() .offset(direction);