mirror of
https://github.com/LeavesMC/Leaves.git
synced 2026-01-04 15:41:31 +00:00
Update Paper
This commit is contained in:
24
patches/server/0052-No-feather-falling-trample.patch
Normal file
24
patches/server/0052-No-feather-falling-trample.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Thu, 25 May 2023 16:37:06 +0800
|
||||
Subject: [PATCH] No feather falling trample
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index d59e33e7326489c6d55d316d0130f22235f4c63c..e48b1b7dbfb5d6914420bce0565108c34342922b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -112,6 +112,13 @@ public class FarmBlock extends Block {
|
||||
public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
||||
super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage.
|
||||
if (!world.isClientSide && world.random.nextFloat() < fallDistance - 0.5F && entity instanceof LivingEntity && (entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) {
|
||||
+ // Leaves start - noFeatherFallingTrample
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.noFeatherFallingTrample) {
|
||||
+ if (net.minecraft.world.item.enchantment.EnchantmentHelper.getEnchantmentLevel(world.registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.ENCHANTMENT).getHolder(net.minecraft.world.item.enchantment.Enchantments.FEATHER_FALLING).get(), (LivingEntity) entity) > 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // Leaves end - noFeatherFallingTrample
|
||||
// CraftBukkit start - Interact soil
|
||||
org.bukkit.event.Cancellable cancellable;
|
||||
if (entity instanceof Player) {
|
||||
Reference in New Issue
Block a user