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 f8258f762..6d0594123 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 @@ -32,6 +32,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; import net.minecraft.core.Direction.AxisDirection; +import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; @@ -373,6 +374,13 @@ public class ContraptionCollider { return entityMotion; if (!entity.isOnGround()) return entityMotion; + + CompoundTag persistentData = entity.getPersistentData(); + if (persistentData.contains("ContraptionGrounded")) { + persistentData.remove("ContraptionGrounded"); + return entityMotion; + } + if (cce.collidingEntities.containsKey(entity)) return entityMotion; if (entity instanceof ItemEntity) @@ -413,7 +421,7 @@ public class ContraptionCollider { .add(0, .25, 0) .scale(damage * 4)) .add(diffMotion); - + return VecHelper.clamp(added, 3); } diff --git a/src/main/java/com/simibubi/create/foundation/mixin/EntityContraptionInteractionMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/EntityContraptionInteractionMixin.java index 27fe5f5cb..f52baa2cb 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/EntityContraptionInteractionMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/EntityContraptionInteractionMixin.java @@ -141,6 +141,8 @@ public abstract class EntityContraptionInteractionMixin extends CapabilityProvid return; self.setOnGround(true); + self.getPersistentData() + .putBoolean("ContraptionGrounded", true); } @Inject(method = { "spawnSprintParticle" }, at = @At(value = "TAIL"))