mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
70 lines
3.3 KiB
Diff
70 lines
3.3 KiB
Diff
From 3ba680a8a7fb7db101ca8b54a7e26eff2193d0f5 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sun, 25 Aug 2019 00:09:52 -0500
|
|
Subject: [PATCH] Dispenser curse of binding protection
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityInsentient.java | 7 +++++++
|
|
src/main/java/net/minecraft/server/ItemArmor.java | 3 ++-
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
|
3 files changed, 14 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
index fbca429090..bf9d044b0b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
@@ -913,6 +913,13 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public static EnumItemSlot getSlotForDispenser(ItemStack itemstack) {
|
|
+ return EnchantmentManager.getEnchantmentLevel(Enchantments.BINDING_CURSE, itemstack) > 0 ? EnumItemSlot.MAINHAND : getSlotForItemStack(itemstack);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
+ public static EnumItemSlot getSlotForItemStack(ItemStack itemstack) { return h(itemstack); } // Purpur - OBFHELPER
|
|
public static EnumItemSlot h(ItemStack itemstack) {
|
|
Item item = itemstack.getItem();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ItemArmor.java b/src/main/java/net/minecraft/server/ItemArmor.java
|
|
index df8c42bfbd..a4b3d0c298 100644
|
|
--- a/src/main/java/net/minecraft/server/ItemArmor.java
|
|
+++ b/src/main/java/net/minecraft/server/ItemArmor.java
|
|
@@ -31,7 +31,7 @@ public class ItemArmor extends Item {
|
|
return false;
|
|
} else {
|
|
EntityLiving entityliving = (EntityLiving) list.get(0);
|
|
- EnumItemSlot enumitemslot = EntityInsentient.h(itemstack);
|
|
+ EnumItemSlot enumitemslot = isourceblock.getWorld().purpurConfig.dispenserApplyCursedArmor ? EntityInsentient.getSlotForItemStack(itemstack) : EntityInsentient.getSlotForDispenser(itemstack); // Purpur
|
|
ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
|
|
// CraftBukkit start
|
|
World world = isourceblock.getWorld();
|
|
@@ -79,6 +79,7 @@ public class ItemArmor extends Item {
|
|
BlockDispenser.a((IMaterial) this, ItemArmor.a);
|
|
}
|
|
|
|
+ public EnumItemSlot getEquipmentSlot() { return b(); } // Purpur - OBFHELPER
|
|
public EnumItemSlot b() {
|
|
return this.b;
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 1a2512b528..b8754ba2d2 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -106,6 +106,11 @@ public class PurpurWorldConfig {
|
|
campfireFallWithGravity = getBoolean("blocks.campfire.fall-with-gravity", campfireFallWithGravity);
|
|
}
|
|
|
|
+ public boolean dispenserApplyCursedArmor = true;
|
|
+ private void dispenserSettings() {
|
|
+ dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor);
|
|
+ }
|
|
+
|
|
public boolean farmlandGetsMoistFromBelow = false;
|
|
private void farmlandSettings() {
|
|
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
|
--
|
|
2.24.0
|
|
|