SPIGOT-974: Add ArmorStand locking API
By: Martoph <sager1018@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user