mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 19:07:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 7caed1a8 [CI-SKIP] Rebuild patches 777073a5 Check horse entity validity in container interactions (#2584) d69fe6c5 Fix zero-tick instant grow farms MC-113809 (#2559) c68dbb86 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#2576) 1e521994 Update Paperclip 30f9955e Fix race conditions in flush allowing for previously scheduled tasks to execute later than the flush call (#2548) 9e1620e3 Improve save logic (#2485) 72860501 [CI-SKIP] Fix duplicate patch number 87355875 Fix nether portal frame creation (#2546) 26acc9b7 Re-add flat bedrock config option
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
From ab7ff9d590be6e82071b6bdae20dc7669d154703 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 | 8 +++++++-
|
||||
src/main/java/net/minecraft/server/ItemArmor.java | 3 ++-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
3 files changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 2a74c3d18..610bf5458 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -896,9 +896,15 @@ 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();
|
||||
-
|
||||
return item != Blocks.CARVED_PUMPKIN.getItem() && (!(item instanceof ItemBlock) || !(((ItemBlock) item).getBlock() instanceof BlockSkullAbstract)) ? (item instanceof ItemArmor ? ((ItemArmor) item).b() : (item == Items.ELYTRA ? EnumItemSlot.CHEST : (item == Items.SHIELD ? EnumItemSlot.OFFHAND : EnumItemSlot.MAINHAND))) : EnumItemSlot.HEAD;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemArmor.java b/src/main/java/net/minecraft/server/ItemArmor.java
|
||||
index dec03e4ae..ce77b7e33 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemArmor.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemArmor.java
|
||||
@@ -33,7 +33,7 @@ public class ItemArmor extends Item {
|
||||
return ItemStack.a;
|
||||
} 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();
|
||||
@@ -81,6 +81,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 8915bc9ea..3ff5dc4a3 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -107,6 +107,11 @@ public class PurpurWorldConfig {
|
||||
campfiresGoOutInRain = getBoolean("campfires-go-out-in-rain", campfiresGoOutInRain);
|
||||
}
|
||||
|
||||
+ public boolean dispenserApplyCursedArmor = true;
|
||||
+ private void dispenserApplyCursedArmor() {
|
||||
+ dispenserApplyCursedArmor = getBoolean("dispenser-apply-cursed-armor-slots", dispenserApplyCursedArmor);
|
||||
+ }
|
||||
+
|
||||
public boolean allowMoistSoilFromWaterBelow = true;
|
||||
private void allowMoistSoilFromWaterBelow() {
|
||||
allowMoistSoilFromWaterBelow = getBoolean("allow-moist-soil-from-water-below", allowMoistSoilFromWaterBelow);
|
||||
--
|
||||
2.23.0.rc1
|
||||
|
||||
Reference in New Issue
Block a user