make set property private on ArmorStandVehicleEntity

This commit is contained in:
Pyrbu 2024-12-13 00:57:36 +01:00
parent 7fbe42e207
commit f8d5700b9a

View file

@ -21,9 +21,9 @@ public class ArmorStandVehicleEntity implements PropertyHolder {
private final Map<EntityPropertyImpl<?>, 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 <T> void setProperty(EntityProperty<T> key, T value) {
private <T> void _setProperty(EntityProperty<T> key, T value) {
Object val = value;
if (val instanceof ItemStack) val = SpigotConversionUtil.fromBukkitItemStack((ItemStack) val);
setProperty((EntityPropertyImpl<T>) key, (T) val);
}
@Override
public <T> void setProperty(EntityProperty<T> 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");