mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-23 00:49:23 +00:00
25 lines
1.7 KiB
Diff
25 lines
1.7 KiB
Diff
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 59bbdead2ebd8965d222540c7243dde051bbcc4b..3eaa46b60aa8f4fcdbfa54dbcf1e051ec2eda140 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
@@ -111,6 +111,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 (top.leavesmc.leaves.LeavesConfig.noFeatherFallingTrample) {
|
|
+ if (net.minecraft.world.item.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.FALL_PROTECTION, (LivingEntity) entity) > 0) {
|
|
+ return;
|
|
+ }
|
|
+ }
|
|
+ // Leaves end - noFeatherFallingTrample
|
|
// CraftBukkit start - Interact soil
|
|
org.bukkit.event.Cancellable cancellable;
|
|
if (entity instanceof Player) {
|