9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-20 15:29:35 +00:00
Files
LeavesMC/patches/server/0124-Protection-stacking.patch
violetc f40d340092 1.20.6 (#216)
---------

Co-authored-by: MC_XiaoHei <xiaohei.xor7studio@foxmail.com>
Co-authored-by: Bluemangoo <chenfy2006@qq.com>
2024-05-20 23:03:56 +08:00

23 lines
1.3 KiB
Diff

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)