diff --git a/src/generated/resources/data/create/advancements/aesthetics.json b/src/generated/resources/data/create/advancements/aesthetics.json index 59a86f429..d723cbe38 100644 --- a/src/generated/resources/data/create/advancements/aesthetics.json +++ b/src/generated/resources/data/create/advancements/aesthetics.json @@ -28,8 +28,8 @@ "trigger": "create:bracket_apply", "conditions": { "accepted_entries": [ - "create:large_cogwheel", - "create:cogwheel" + "create:cogwheel", + "create:large_cogwheel" ] } }, diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java index c8d8921c5..d103936c1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/interaction/controls/ControlsMovementBehaviour.java @@ -18,7 +18,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public class ControlsMovementBehaviour extends MovementBehaviour { +public class ControlsMovementBehaviour implements MovementBehaviour { // TODO: rendering the levers should be specific to Carriage Contraptions - static class LeverAngles { @@ -29,7 +29,7 @@ public class ControlsMovementBehaviour extends MovementBehaviour { @Override public void tick(MovementContext context) { - super.tick(context); + MovementBehaviour.super.tick(context); if (!context.world.isClientSide) return; if (!(context.temporaryData instanceof LeverAngles)) diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java index d8d1b37c2..4f68885fc 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Carriage.java @@ -25,7 +25,6 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity.RemovalReason; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; @@ -175,14 +174,10 @@ public class Carriage { this.entity = new WeakReference<>(cce); } - public ChunkPos getChunk() { - return new ChunkPos(new BlockPos(positionAnchor)); - } - public void manageEntity(Level level) { CarriageContraptionEntity entity = this.entity.get(); if (entity == null) { - if (CarriageEntityHandler.isActiveChunk(level, getChunk())) + if (CarriageEntityHandler.isActiveChunk(level, new BlockPos(positionAnchor))) createEntity(level); } else { CarriageEntityHandler.validateCarriageEntity(entity); diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageEntityHandler.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageEntityHandler.java index e288e4f86..3cc309af5 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageEntityHandler.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/CarriageEntityHandler.java @@ -1,9 +1,9 @@ package com.simibubi.create.content.logistics.trains.entity; +import net.minecraft.core.BlockPos; import net.minecraft.core.SectionPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.Level; import net.minecraftforge.event.entity.EntityEvent; @@ -22,7 +22,7 @@ public class CarriageEntityHandler { Level level = entity.getLevel(); if (level.isClientSide) return; - if (!isActiveChunk(level, newPos.chunk())) + if (!isActiveChunk(level, newPos.center())) cce.leftTickingChunks = true; } @@ -32,13 +32,13 @@ public class CarriageEntityHandler { Level level = entity.getLevel(); if (level.isClientSide) return; - if (!isActiveChunk(level, entity.chunkPosition())) + if (!isActiveChunk(level, entity.blockPosition())) entity.leftTickingChunks = true; } - public static boolean isActiveChunk(Level level, ChunkPos chunk) { + public static boolean isActiveChunk(Level level, BlockPos pos) { if (level instanceof ServerLevel serverLevel) - return serverLevel.isPositionEntityTicking(chunk); + return serverLevel.isPositionEntityTicking(pos); return false; }