mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-29 03:49:10 +00:00
23 lines
1.3 KiB
Diff
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 6a75ede277c2515214ce5181d177edd8e0006ab7..28451f664f39f23fe7102cfeef85e2962cca35b3 100644
|
|
--- a/src/main/java/net/minecraft/world/item/enchantment/ProtectionEnchantment.java
|
|
+++ b/src/main/java/net/minecraft/world/item/enchantment/ProtectionEnchantment.java
|
|
@@ -48,6 +48,11 @@ public class ProtectionEnchantment extends Enchantment {
|
|
|
|
@Override
|
|
public boolean checkCompatibility(Enchantment other) {
|
|
+ // Leaves start - protection stacking
|
|
+ if (top.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)
|