Do not fill attributes by default

This commit is contained in:
themode 2021-03-22 15:20:24 +01:00
parent 169dbedea2
commit 7cd2d1b896

View File

@ -88,7 +88,6 @@ public class LivingEntity extends Entity implements EquipmentHandler {
*/
public LivingEntity(@NotNull EntityType entityType, @NotNull UUID uuid) {
this(entityType, uuid, new Position());
setupAttributes();
setGravity(0.02f, 0.08f, 3.92f);
initEquipments();
}
@ -103,7 +102,6 @@ public class LivingEntity extends Entity implements EquipmentHandler {
@Deprecated
public LivingEntity(@NotNull EntityType entityType, @NotNull UUID uuid, @NotNull Position spawnPosition) {
super(entityType, uuid, spawnPosition);
setupAttributes();
setGravity(0.02f, 0.08f, 3.92f);
initEquipments();
}
@ -641,16 +639,6 @@ public class LivingEntity extends Entity implements EquipmentHandler {
return propertiesPacket;
}
/**
* Sets all the attributes to {@link Attribute#getDefaultValue()}
*/
private void setupAttributes() {
for (Attribute attribute : Attribute.values()) {
final AttributeInstance attributeInstance = new AttributeInstance(attribute, this::onAttributeChanged);
this.attributeModifiers.put(attribute.getKey(), attributeInstance);
}
}
@Override
protected void handleVoid() {
// Kill if in void