Fix ageable entity scales not applying by default

Fixes #3486
This commit is contained in:
Camotoy 2022-12-31 19:34:43 -05:00
parent 566b2635c0
commit 3437fc98d8
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 6 additions and 6 deletions

View file

@ -40,6 +40,12 @@ public class AgeableEntity extends CreatureEntity {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
} }
@Override
protected void initializeMetadata() {
// Required as of 1.19.3 Java
dirtyMetadata.put(EntityData.SCALE, getAdultSize());
}
public void setBaby(BooleanEntityMetadata entityMetadata) { public void setBaby(BooleanEntityMetadata entityMetadata) {
boolean isBaby = entityMetadata.getPrimitiveValue(); boolean isBaby = entityMetadata.getPrimitiveValue();
dirtyMetadata.put(EntityData.SCALE, isBaby ? getBabySize() : getAdultSize()); dirtyMetadata.put(EntityData.SCALE, isBaby ? getBabySize() : getAdultSize());

View file

@ -25,7 +25,6 @@
package org.geysermc.geyser.entity.type.living.animal; package org.geysermc.geyser.entity.type.living.animal;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
import com.nukkitx.math.vector.Vector3f; import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityData;
@ -42,11 +41,6 @@ public class RabbitEntity extends AnimalEntity {
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
} }
@Override
public void setBaby(BooleanEntityMetadata entityMetadata) {
super.setBaby(entityMetadata);
}
public void setRabbitVariant(IntEntityMetadata entityMetadata) { public void setRabbitVariant(IntEntityMetadata entityMetadata) {
int variant = entityMetadata.getPrimitiveValue(); int variant = entityMetadata.getPrimitiveValue();