mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 19:07:44 +01:00
at 100 now
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 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
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 43f2654eb0a396bce98e0840bdc8a8b16f00b2ba..b30292dcc9bbfc0ded94ee8a0f4a5e949327da54 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -66,6 +66,7 @@ import net.minecraft.world.item.ProjectileWeaponItem;
|
||||
import net.minecraft.world.item.SpawnEggItem;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
+import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -1183,6 +1184,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static @Nullable EquipmentSlot getSlotForDispenser(ItemStack itemstack) {
|
||||
+ return EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BINDING_CURSE, itemstack) > 0 ? null : getEquipmentSlotForItem(itemstack);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Nullable
|
||||
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 6b81be03f87967124b046708557e05d519aa79e4..b47cc957f9e4936b15b80a6f685ddddb5b289298 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
@@ -67,7 +67,7 @@ public class ArmorItem extends Item implements Equipable {
|
||||
return false;
|
||||
} else {
|
||||
LivingEntity entityliving = (LivingEntity) list.get(0);
|
||||
- EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor);
|
||||
+ EquipmentSlot enumitemslot = pointer.level().purpurConfig.dispenserApplyCursedArmor ? Mob.getEquipmentSlotForItem(armor) : Mob.getSlotForDispenser(armor); if (enumitemslot == null) return false; // Purpur
|
||||
ItemStack itemstack1 = armor.copyWithCount(1); // Paper - shrink below and single item in event
|
||||
// CraftBukkit start
|
||||
Level world = pointer.level();
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 03c35e455b405517114ffc043732359c112e343f..27c1f09be7d664073263a02a8854ff1e8c6f9ab1 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -224,6 +224,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ 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);
|
||||
Reference in New Issue
Block a user