Revert this particular change since it wasn't quite ready yet

This commit is contained in:
Camotoy 2021-12-05 19:07:51 -05:00
parent e954d091b9
commit 70ec77b1e3
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -255,14 +255,9 @@ public class LivingEntity extends Entity {
if (javaAttribute.getType() instanceof AttributeType.Builtin type) {
switch (type) {
case GENERIC_MAX_HEALTH -> {
float maxHealth = (float) AttributeUtils.calculateValue(javaAttribute);
if (this.maxHealth != maxHealth) {
// Helps prnt respawn bugs where the player respawns twice
// Because we re-sent the health attribute as 0
this.maxHealth = maxHealth;
this.maxHealth = (float) AttributeUtils.calculateValue(javaAttribute);
newAttributes.add(createHealthAttribute());
}
}
case GENERIC_ATTACK_DAMAGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.ATTACK_DAMAGE));
case GENERIC_FLYING_SPEED -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FLYING_SPEED));
case GENERIC_MOVEMENT_SPEED -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.MOVEMENT_SPEED));