use of com.destroystokyo.paper.inventory.meta.ArmorStandMeta in project Denizen-For-Bukkit by DenizenScript.
the class ItemArmorStand method getDataMap.
public MapTag getDataMap() {
ArmorStandMeta meta = (ArmorStandMeta) item.getItemMeta();
if (meta == null) {
return null;
}
MapTag result = new MapTag();
result.putObject("base_plate", new ElementTag(!meta.hasNoBasePlate()));
result.putObject("visible", new ElementTag(!meta.isInvisible()));
result.putObject("marker", new ElementTag(meta.isMarker()));
result.putObject("is_small", new ElementTag(meta.isSmall()));
result.putObject("arms", new ElementTag(meta.shouldShowArms()));
return result;
}
use of com.destroystokyo.paper.inventory.meta.ArmorStandMeta in project Denizen-For-Bukkit by DenizenScript.
the class ItemArmorStand method adjust.
@Override
public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("armor_stand_data") && mechanism.requireObject(MapTag.class)) {
MapTag map = mechanism.valueAsType(MapTag.class);
ArmorStandMeta meta = (ArmorStandMeta) item.getItemMeta();
ObjectTag base_plate = map.getObject("base_plate");
ObjectTag visible = map.getObject("visible");
ObjectTag marker = map.getObject("marker");
ObjectTag is_small = map.getObject("is_small");
ObjectTag arms = map.getObject("arms");
if (base_plate != null) {
meta.setNoBasePlate(!((ElementTag) base_plate).asBoolean());
}
if (visible != null) {
meta.setInvisible(!((ElementTag) visible).asBoolean());
}
if (marker != null) {
meta.setMarker(((ElementTag) marker).asBoolean());
}
if (is_small != null) {
meta.setSmall(((ElementTag) is_small).asBoolean());
}
if (arms != null) {
meta.setShowArms(((ElementTag) arms).asBoolean());
}
item.setItemMeta(meta);
}
}
Aggregations