mirror of
https://github.com/LeavesMC/Leaves.git
synced 2026-01-06 15:51:33 +00:00
Protection stacking (#29)
This commit is contained in:
22
patches/server/0127-Protection-stacking.patch
Normal file
22
patches/server/0127-Protection-stacking.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
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 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;
|
||||
Reference in New Issue
Block a user