mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Updated Upstream (Paper)
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
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
From ab6859b1dd1b906b4c268ae29f01824618083f52 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 a35459d09..84f208b8c 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 df8c42bfb..a4b3d0c29 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 1a2512b52..b8754ba2d 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
|
||||
|
||||
Reference in New Issue
Block a user