Files
Purpur/patches/server/0249-Option-to-disable-turtle-egg-trampling-with-feather-.patch
granny 0458d847e2 Updated Upstream (Paper & Pufferfish)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@44ee1cd fix recipe packet limiter (#9841)
PaperMC/Paper@e57af7d sync netty version with vanilla (#9842)

Pufferfish Changes:
pufferfish-gg/Pufferfish@0020a8b Port a patch from upstream
pufferfish-gg/Pufferfish@979d3a2 Update upstream (last 1.20.1)
pufferfish-gg/Pufferfish@06262c1 Initial 1.20.2 update
2023-10-16 04:52:01 -07:00

45 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 12emin34 <macanovic.emin@gmail.com>
Date: Mon, 9 May 2022 23:18:09 +0200
Subject: [PATCH] Option to disable turtle egg trampling with feather falling
diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
index 8e975daca6a50c95d7fb620f2756b8bb2b7c7d6b..e23b920be6702ef6faf97b42fb8a87442707d6be 100644
--- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
@@ -211,7 +211,13 @@ public class TurtleEggBlock extends Block {
if (!(entity instanceof LivingEntity)) {
return false;
}
- if (entity instanceof Player) return true;
+ if (world.purpurConfig.turtleEggsTramplingFeatherFalling) {
+ java.util.Iterator<ItemStack> armor = entity.getArmorSlots().iterator();
+ return !armor.hasNext() || net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.FALL_PROTECTION, armor.next()) < (int) entity.fallDistance;
+ }
+ if (entity instanceof Player) {
+ return true;
+ }
return world.purpurConfig.turtleEggsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
// Purpur end
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 6ae50abd3d1bb4e5ff6f8865ca6f4303c8144b0e..ce4f8f9661c6c0d09fa517861aae80559859f09f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1026,12 +1026,14 @@ public class PurpurWorldConfig {
public boolean turtleEggsBreakFromMinecarts = true;
public boolean turtleEggsBypassMobGriefing = false;
public int turtleEggsRandomTickCrackChance = 500;
+ public boolean turtleEggsTramplingFeatherFalling = false;
private void turtleEggSettings() {
turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
turtleEggsBypassMobGriefing = getBoolean("blocks.turtle_egg.bypass-mob-griefing", turtleEggsBypassMobGriefing);
turtleEggsRandomTickCrackChance = getInt("blocks.turtle_egg.random-tick-crack-chance", turtleEggsRandomTickCrackChance);
+ turtleEggsTramplingFeatherFalling = getBoolean("blocks.turtle_egg.feather-fall-distance-affects-trampling", turtleEggsTramplingFeatherFalling);
}
public int waterInfiniteRequiredSources = 2;