From 647a2489a191030a5b94ebd41d6bf0f42829f09b Mon Sep 17 00:00:00 2001 From: cake Date: Mon, 4 May 2026 18:02:27 +0100 Subject: [PATCH 1/2] Add entity fall on block mixin for seats --- .../entity_falls_on_block/SeatBlockMixin.java | 23 +++++++++++++++++++ .../main/resources/sable-neoforge.mixins.json | 1 + 2 files changed, 24 insertions(+) create mode 100644 neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java diff --git a/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java b/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java new file mode 100644 index 00000000..7a2aae8e --- /dev/null +++ b/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java @@ -0,0 +1,23 @@ +package dev.ryanhcode.sable.neoforge.mixin.compatibility.create.entity_falls_on_block; + +import com.simibubi.create.content.contraptions.actors.seat.SeatBlock; +import com.simibubi.create.content.processing.basin.BasinBlock; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +/** + * Makes seats use the standing on position of entities instead of their block position for picking them up, as the + * on position of entities will be overwritten by Sable to be inside of the plot of a sub-level an entity is resting on + */ +@Mixin(SeatBlock.class) +public class SeatBlockMixin { + + @Redirect(method = "updateEntityAfterFallOn", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;blockPosition()Lnet/minecraft/core/BlockPos;")) + private BlockPos sable$updateEntityAfterFallOn(final Entity instance) { + return instance.getOnPos(); + } + +} diff --git a/neoforge/src/main/resources/sable-neoforge.mixins.json b/neoforge/src/main/resources/sable-neoforge.mixins.json index 68bd1fc5..a5f64e49 100644 --- a/neoforge/src/main/resources/sable-neoforge.mixins.json +++ b/neoforge/src/main/resources/sable-neoforge.mixins.json @@ -101,6 +101,7 @@ "compatibility.create.entity_falls_on_block.BasinBlockMixin", "compatibility.create.entity_falls_on_block.BeltMillstoneBlocksMixin", "compatibility.create.entity_falls_on_block.SawBlockMixin", + "compatibility.create.entity_falls_on_block.SeatBlockMixin", "compatibility.create.factory_panel.FactoryPanelConnectionHandlerMixin", "compatibility.create.fans_provide_force.EncasedFanBlockEntityMixin", "compatibility.create.fluid_handling.OpenEndedPipeMixin", From 598ca489c226eb2227ca539c8213ef028d23cca1 Mon Sep 17 00:00:00 2001 From: cake Date: Mon, 4 May 2026 18:04:40 +0100 Subject: [PATCH 2/2] Fix doc --- .../create/entity_falls_on_block/SeatBlockMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java b/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java index 7a2aae8e..a475f1b0 100644 --- a/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java +++ b/neoforge/src/main/java/dev/ryanhcode/sable/neoforge/mixin/compatibility/create/entity_falls_on_block/SeatBlockMixin.java @@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; /** - * Makes seats use the standing on position of entities instead of their block position for picking them up, as the + * Makes seats use the standing on position of entities instead of their block position for sitting them down, as the * on position of entities will be overwritten by Sable to be inside of the plot of a sub-level an entity is resting on */ @Mixin(SeatBlock.class)