diff --git a/nms-patches/EntityArmorStand.patch b/nms-patches/EntityArmorStand.patch index 7de504dcde..b4e017e06b 100644 --- a/nms-patches/EntityArmorStand.patch +++ b/nms-patches/EntityArmorStand.patch @@ -16,6 +16,15 @@ public class EntityArmorStand extends EntityLiving { private static final Vector3f bj = new Vector3f(0.0F, 0.0F, 0.0F); +@@ -29,7 +38,7 @@ + private final NonNullList armorItems; + private boolean armorStandInvisible; + public long bi; +- private int bv; ++ public int bv; //PAIL private -> public, rename disabledSlots + public Vector3f headPose; + public Vector3f bodyPose; + public Vector3f leftArmPose; @@ -55,6 +64,13 @@ this.setPosition(d0, d1, d2); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java index 2b66a08ade..2530338783 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -2,9 +2,11 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntityArmorStand; import net.minecraft.server.Vector3f; +import org.bukkit.craftbukkit.CraftEquipmentSlot; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.EntityType; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.util.EulerAngle; @@ -211,4 +213,19 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public void setMarker(boolean marker) { getHandle().setMarker(marker); } + + @Override + public void addEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { + getHandle().bv |= (1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8); // PAIL c() rename getSlotFlag() + } + + @Override + public void removeEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { + getHandle().bv &= ~(1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8); + } + + @Override + public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { + return (getHandle().bv & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8)) != 0; + } }