diff --git a/src/main/java/com/simibubi/create/compat/curios/Curios.java b/src/main/java/com/simibubi/create/compat/curios/Curios.java index ef0838eb6..a595bb150 100644 --- a/src/main/java/com/simibubi/create/compat/curios/Curios.java +++ b/src/main/java/com/simibubi/create/compat/curios/Curios.java @@ -19,19 +19,26 @@ public class Curios { modEventBus.addListener(Curios::onInterModEnqueue); modEventBus.addListener(Curios::onClientSetup); - GogglesItem.addIsWearingPredicate(player -> player.getCapability(CuriosCapability.INVENTORY).map(handler -> { - ICurioStacksHandler stacksHandler = handler.getCurios().get("head"); - if (stacksHandler != null) { - return AllItems.GOGGLES.isIn(stacksHandler.getStacks().getStackInSlot(0)); - } - return false; - }).orElse(false)); + GogglesItem.addIsWearingPredicate(player -> player.getCapability(CuriosCapability.INVENTORY) + .map(handler -> { + ICurioStacksHandler stacksHandler = handler.getCurios() + .get("head"); + if (stacksHandler == null) + return false; + if (stacksHandler.getSlots() == 0) + return false; + return AllItems.GOGGLES.isIn(stacksHandler.getStacks() + .getStackInSlot(0)); + }) + .orElse(false)); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(CuriosRenderers::onLayerRegister)); + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, + () -> () -> modEventBus.addListener(CuriosRenderers::onLayerRegister)); } private static void onInterModEnqueue(final InterModEnqueueEvent event) { - InterModComms.sendTo("curios", SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.HEAD.getMessageBuilder().build()); + InterModComms.sendTo("curios", SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.HEAD.getMessageBuilder() + .build()); } private static void onClientSetup(final FMLClientSetupEvent event) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java index 6d0594123..e7c93ef12 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java @@ -339,6 +339,9 @@ public class ContraptionCollider { if (surfaceCollision.isTrue()) { contraptionEntity.registerColliding(entity); entity.fallDistance = 0; + for (Entity rider : entity.getIndirectPassengers()) + if (rider instanceof ServerPlayer playerRider) + playerRider.connection.aboveGroundTickCount = 0; boolean canWalk = bounce != 0 || slide == 0; if (canWalk || !rotation.hasVerticalRotation()) { if (canWalk) diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidDrainingBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidDrainingBehaviour.java index 25c459399..25d568bf1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidDrainingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidDrainingBehaviour.java @@ -269,12 +269,13 @@ public class FluidDrainingBehaviour extends FluidManipulationBehaviour { }, false); } catch (ChunkNotLoadedException e) { tileEntity.sendData(); + frontier.clear(); visited.clear(); } Level world = getWorld(); int maxBlocks = maxBlocks(); - if (visited.size() > maxBlocks && canDrainInfinitely(fluid)) { + if (visited.size() > maxBlocks && canDrainInfinitely(fluid) && !queue.isEmpty()) { infinite = true; // Find first block with valid fluid while (true) { @@ -306,6 +307,7 @@ public class FluidDrainingBehaviour extends FluidManipulationBehaviour { search(fluid, validationFrontier, validationVisited, (e, d) -> newValidationSet.add(e), false); } catch (ChunkNotLoadedException e) { validationFrontier.clear(); + validationVisited.clear(); setLongValidationTimer(); return; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java index 075f31d80..3bb5fb369 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FluidFillingBehaviour.java @@ -76,6 +76,7 @@ public class FluidFillingBehaviour extends FluidManipulationBehaviour { (p, d) -> infinityCheckFrontier.add(new BlockPosEntry(p, d)), true); } catch (ChunkNotLoadedException e) { infinityCheckFrontier.clear(); + infinityCheckVisited.clear(); setLongValidationTimer(); return; } 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 9654e84c8..17db01a2d 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 @@ -36,7 +36,6 @@ public class BlazeBurnerTileEntity extends SmartTileEntity { public static final int MAX_HEAT_CAPACITY = 10000; public static final int INSERTION_THRESHOLD = 500; - public static final int SPECIAL_INSERTION_THRESHOLD = 500; protected FuelType activeFuel; protected int remainingBurnTime; @@ -209,7 +208,7 @@ public class BlazeBurnerTileEntity extends SmartTileEntity { return false; if (newFuel == activeFuel) { - if (remainingBurnTime <= (activeFuel == FuelType.NORMAL ? INSERTION_THRESHOLD : SPECIAL_INSERTION_THRESHOLD)) { + if (remainingBurnTime <= INSERTION_THRESHOLD) { newBurnTime += remainingBurnTime; } else if (forceOverflow && newFuel == FuelType.NORMAL) { if (remainingBurnTime < MAX_HEAT_CAPACITY) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/vault/ItemVaultTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/vault/ItemVaultTileEntity.java index 681bf28e8..9975112c8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/vault/ItemVaultTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/vault/ItemVaultTileEntity.java @@ -71,6 +71,8 @@ public class ItemVaultTileEntity extends SmartTileEntity implements IMultiTileCo if (controllerTE == null) return; + level.blockEntityChanged(controllerTE.worldPosition); + BlockPos pos = controllerTE.getBlockPos(); for (int y = 0; y < controllerTE.radius; y++) { for (int z = 0; z < (controllerTE.axis == Axis.X ? controllerTE.radius : controllerTE.length); z++) { diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java index 5c2d68d6a..258bc4da1 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java @@ -577,6 +577,9 @@ public class Navigation { TrackNode initialNode2 = forward ? startingPoint.node2 : startingPoint.node1; TrackEdge initialEdge = graph.getConnectionsFrom(initialNode1) .get(initialNode2); + if (initialEdge == null) + return; + double distanceToNode2 = forward ? initialEdge.getLength() - startingPoint.position : startingPoint.position; frontier.add(new FrontierEntry(distanceToNode2, 0, initialNode1, initialNode2, initialEdge));