package zero.trampledisablerfabric.mixin; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.FarmlandBlock; import net.minecraft.entity.Entity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(FarmlandBlock.class) public class MixinFarmlandBlock extends Block { public MixinFarmlandBlock(Settings settings) { super(settings); } @Inject(method = {"onLandedUpon(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;F)V"}, at = {@At("HEAD")}, cancellable = true) private void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance, CallbackInfo info) { super.onLandedUpon(world, state, pos, entity, fallDistance); // Don't cancel fall damage info.cancel(); } }