From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:47:05 +0800 Subject: [PATCH] Protection stacking diff --git a/src/main/java/net/minecraft/world/item/enchantment/ProtectionEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/ProtectionEnchantment.java index 8f30cdd7f9f43e5a1d100f6c6d25fb54475289f1..d3942f1df56f8e265179ea81c7bafdc3dfe9e40a 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/ProtectionEnchantment.java +++ b/src/main/java/net/minecraft/world/item/enchantment/ProtectionEnchantment.java @@ -32,6 +32,11 @@ public class ProtectionEnchantment extends Enchantment { @Override public boolean checkCompatibility(Enchantment other) { + // Leaves start - protection stacking + if (org.leavesmc.leaves.LeavesConfig.protectionStacking) { + return super.checkCompatibility(other); + } + // Leaves end - protection stacking return other instanceof ProtectionEnchantment protectionEnchantment ? this.type != protectionEnchantment.type && (this.type == ProtectionEnchantment.Type.FALL || protectionEnchantment.type == ProtectionEnchantment.Type.FALL)