upstream #1

Closed
bridge wants to merge 65 commits from feat/upstream into 2.X
Showing only changes of commit f8d5700b9a - Show all commits

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");