mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
48 lines
3.1 KiB
Diff
48 lines
3.1 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/InventoryMenu.java b/src/main/java/net/minecraft/world/inventory/InventoryMenu.java
|
|
index 111da6398bb561e58571e47743088ce80416234d..0a2c776b9b1da7d0d4481dd527e0068b170cac23 100644
|
|
--- a/src/main/java/net/minecraft/world/inventory/InventoryMenu.java
|
|
+++ b/src/main/java/net/minecraft/world/inventory/InventoryMenu.java
|
|
@@ -4,6 +4,7 @@ import com.mojang.datafixers.util.Pair;
|
|
import net.minecraft.network.chat.TranslatableComponent;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.world.Container;
|
|
+import net.minecraft.world.effect.MobEffects;
|
|
import net.minecraft.world.entity.EquipmentSlot;
|
|
import net.minecraft.world.entity.Mob;
|
|
import net.minecraft.world.entity.player.Inventory;
|
|
@@ -88,7 +89,7 @@ public class InventoryMenu extends RecipeBookMenu<CraftingContainer> {
|
|
public boolean mayPickup(Player playerEntity) {
|
|
ItemStack itemstack = this.getItem();
|
|
|
|
- return !itemstack.isEmpty() && !playerEntity.isCreative() && EnchantmentHelper.hasBindingCurse(itemstack) ? false : super.mayPickup(playerEntity);
|
|
+ return !itemstack.isEmpty() && !playerEntity.isCreative() && EnchantmentHelper.hasBindingCurse(itemstack) ? playerEntity.level.purpurConfig.playerRemoveBindingWithWeakness && playerEntity.hasEffect(MobEffects.WEAKNESS) : super.mayPickup(playerEntity); // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index a0304c89411a1226457747eb1f142676367958dc..2d81bb200943a2e11679babf680705374f81e7c3 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -359,6 +359,7 @@ public class PurpurWorldConfig {
|
|
public boolean playerArmorSwapping = false;
|
|
public boolean playerArmorSwappingCreativeMakesCopy = true;
|
|
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);
|
|
@@ -385,6 +386,7 @@ public class PurpurWorldConfig {
|
|
playerArmorSwapping = getBoolean("gameplay-mechanics.player.armor-click-equip.allow-hot-swapping", playerArmorSwapping);
|
|
playerArmorSwappingCreativeMakesCopy = getBoolean("gameplay-mechanics.player.armor-click-equip.creative-makes-copy", playerArmorSwappingCreativeMakesCopy);
|
|
playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
|
|
+ playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness);
|
|
}
|
|
|
|
public int snowballDamage = -1;
|