mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Fix #491
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Dispenser curse of binding protection
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 6848b8a21a4ad3e7dc4cfdb4a73045bf918999b1..f7c915ababdacd0901787d6dd1c08accacadabe5 100644
|
||||
index 6848b8a21a4ad3e7dc4cfdb4a73045bf918999b1..2c35070bc7c0a4195f824643c093df1c6aa59dfc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -62,6 +62,7 @@ import net.minecraft.world.item.ProjectileWeaponItem;
|
||||
@@ -21,8 +21,8 @@ index 6848b8a21a4ad3e7dc4cfdb4a73045bf918999b1..f7c915ababdacd0901787d6dd1c08acc
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static EquipmentSlot getSlotForDispenser(ItemStack itemstack) {
|
||||
+ return EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BINDING_CURSE, itemstack) > 0 ? EquipmentSlot.MAINHAND : getEquipmentSlotForItem(itemstack);
|
||||
+ public static @Nullable EquipmentSlot getSlotForDispenser(ItemStack itemstack) {
|
||||
+ return EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BINDING_CURSE, itemstack) > 0 ? null : getEquipmentSlotForItem(itemstack);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@@ -30,7 +30,7 @@ index 6848b8a21a4ad3e7dc4cfdb4a73045bf918999b1..f7c915ababdacd0901787d6dd1c08acc
|
||||
public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel) {
|
||||
switch (equipmentSlot) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
index aab4a63e61aced51b1b6c885fd8b8426a4f14408..ad095c6bc7e00d286c83e37f84d8ed5d4a2c6881 100644
|
||||
index aab4a63e61aced51b1b6c885fd8b8426a4f14408..dba3b8e0671ee63ff077155a8964f3e245740e7e 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
@@ -56,7 +56,7 @@ public class ArmorItem extends Item implements Wearable {
|
||||
@@ -38,7 +38,7 @@ index aab4a63e61aced51b1b6c885fd8b8426a4f14408..ad095c6bc7e00d286c83e37f84d8ed5d
|
||||
} else {
|
||||
LivingEntity entityliving = (LivingEntity) list.get(0);
|
||||
- EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor);
|
||||
+ EquipmentSlot enumitemslot = pointer.getLevel().purpurConfig.dispenserApplyCursedArmor ? Mob.getEquipmentSlotForItem(armor) : Mob.getSlotForDispenser(armor); // Purpur
|
||||
+ EquipmentSlot enumitemslot = pointer.getLevel().purpurConfig.dispenserApplyCursedArmor ? Mob.getEquipmentSlotForItem(armor) : Mob.getSlotForDispenser(armor); if (enumitemslot == null) return false; // Purpur
|
||||
ItemStack itemstack1 = armor.split(1);
|
||||
// CraftBukkit start
|
||||
Level world = pointer.getLevel();
|
||||
|
||||
Reference in New Issue
Block a user