diff --git a/src/main/java/com/sudolev/interiors/foundation/mixin/SeatBlockMixin.java b/src/main/java/com/sudolev/interiors/foundation/mixin/SeatBlockMixin.java index 9a6fca00..db8490c3 100644 --- a/src/main/java/com/sudolev/interiors/foundation/mixin/SeatBlockMixin.java +++ b/src/main/java/com/sudolev/interiors/foundation/mixin/SeatBlockMixin.java @@ -1,6 +1,7 @@ package com.sudolev.interiors.foundation.mixin; import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; @@ -15,10 +16,13 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; @Mixin(value = SeatBlock.class, remap = false) public abstract class SeatBlockMixin { + @Inject(method = "isSeatOccupied", at = @At("HEAD"), cancellable = true) private static void sitDown(Level world, BlockPos pos, CallbackInfoReturnable cir) { if(!world.getEntitiesOfClass(BigSeatEntity.class, new AABB(pos)).isEmpty()) @@ -27,10 +31,15 @@ private static void sitDown(Level world, BlockPos pos, CallbackInfoReturnable