From f8d5700b9a188a870689faad6a762927a3e92c08 Mon Sep 17 00:00:00 2001 From: Pyrbu Date: Fri, 13 Dec 2024 00:57:36 +0100 Subject: [PATCH] make set property private on ArmorStandVehicleEntity --- .../znpcsplus/entity/ArmorStandVehicleEntity.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/entity/ArmorStandVehicleEntity.java b/plugin/src/main/java/lol/pyr/znpcsplus/entity/ArmorStandVehicleEntity.java index 0bc3886..ff53417 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/entity/ArmorStandVehicleEntity.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/entity/ArmorStandVehicleEntity.java @@ -21,9 +21,9 @@ public class ArmorStandVehicleEntity implements PropertyHolder { private final Map, Object> propertyMap = new HashMap<>(); public ArmorStandVehicleEntity(EntityPropertyRegistryImpl propertyRegistry) { - setProperty(propertyRegistry.getByName("small", Boolean.class), true); - setProperty(propertyRegistry.getByName("invisible", Boolean.class), true); - setProperty(propertyRegistry.getByName("base_plate", Boolean.class), false); + _setProperty(propertyRegistry.getByName("small", Boolean.class), true); + _setProperty(propertyRegistry.getByName("invisible", Boolean.class), true); + _setProperty(propertyRegistry.getByName("base_plate", Boolean.class), false); } @SuppressWarnings("unchecked") @@ -37,14 +37,18 @@ public class ArmorStandVehicleEntity implements PropertyHolder { } @SuppressWarnings("unchecked") - @Override - public void setProperty(EntityProperty key, T value) { + private void _setProperty(EntityProperty key, T value) { Object val = value; if (val instanceof ItemStack) val = SpigotConversionUtil.fromBukkitItemStack((ItemStack) val); setProperty((EntityPropertyImpl) key, (T) val); } + @Override + public void setProperty(EntityProperty key, T value) { + throw new UnsupportedOperationException("Cannot set properties on armor stands"); + } + @Override public void setItemProperty(EntityProperty key, ItemStack value) { throw new UnsupportedOperationException("Cannot set item properties on armor stands");