forked from LeavesMC/Leaves
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd6ee38
commit cb0ed1c
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: violetc <[email protected]> | ||
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 ba8bd0df934f28c5dae6fd8a85ec0b73f6d3aa31..cdb7dea2dc9fcafcdb7eaf8750a7c637bffc00e9 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 | ||
if (other instanceof ProtectionEnchantment protectionEnchantment) { | ||
if (this.type == protectionEnchantment.type) { | ||
return false; |