mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
40 lines
2.6 KiB
Diff
40 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Encode42 <me@encode42.dev>
|
|
Date: Sun, 8 Aug 2021 16:59:21 -0400
|
|
Subject: [PATCH] Config to remove curse of binding with weakness
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/inventory/ArmorSlot.java b/src/main/java/net/minecraft/world/inventory/ArmorSlot.java
|
|
index 6c0b6abb1698fac9bb902f695b725d4ab783ee90..091e3c3514fcb378b68098114106d09f04d8fb0d 100644
|
|
--- a/src/main/java/net/minecraft/world/inventory/ArmorSlot.java
|
|
+++ b/src/main/java/net/minecraft/world/inventory/ArmorSlot.java
|
|
@@ -45,7 +45,7 @@ class ArmorSlot extends Slot {
|
|
@Override
|
|
public boolean mayPickup(Player playerEntity) {
|
|
ItemStack itemStack = this.getItem();
|
|
- return (itemStack.isEmpty() || playerEntity.isCreative() || !EnchantmentHelper.has(itemStack, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE))
|
|
+ return (itemStack.isEmpty() || playerEntity.isCreative() || (!EnchantmentHelper.has(itemStack, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE) || playerEntity.level().purpurConfig.playerRemoveBindingWithWeakness && playerEntity.hasEffect(net.minecraft.world.effect.MobEffects.WEAKNESS)))
|
|
&& super.mayPickup(playerEntity);
|
|
}
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 09b753d35c412e102a0d9557326e10f99293a784..223c94383b315d933be94decc2ceb4646cb2d0e4 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -399,6 +399,7 @@ public class PurpurWorldConfig {
|
|
public int playerBurpDelay = 10;
|
|
public boolean playerBurpWhenFull = false;
|
|
public boolean playerRidableInWater = false;
|
|
+ public boolean playerRemoveBindingWithWeakness = false;
|
|
private void playerSettings() {
|
|
if (PurpurConfig.version < 19) {
|
|
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
|
@@ -422,6 +423,7 @@ public class PurpurWorldConfig {
|
|
playerBurpDelay = getInt("gameplay-mechanics.player.burp-delay", playerBurpDelay);
|
|
playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull);
|
|
playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
|
|
+ playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness);
|
|
}
|
|
|
|
public boolean silkTouchEnabled = false;
|