From d80c31f1c25ca3c75ddf59c3f8e86d7242606c41 Mon Sep 17 00:00:00 2001 From: Dylan Ogle Date: Sat, 29 May 2021 14:37:03 +0100 Subject: [PATCH] Fix cats being larger than normal and implement resting (#2238) * Use the correct scale for cats. * Implement resting --- .../entity/living/animal/tameable/CatEntity.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/animal/tameable/CatEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/animal/tameable/CatEntity.java index 2d56d0c18..6869717a0 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/living/animal/tameable/CatEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/living/animal/tameable/CatEntity.java @@ -49,7 +49,14 @@ public class CatEntity extends TameableEntity { @Override public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) { super.updateBedrockMetadata(entityMetadata, session); - if (entityMetadata.getId() == 16) { + if (entityMetadata.getId() == 15) { + metadata.put(EntityData.SCALE, .8f); + boolean isBaby = (boolean) entityMetadata.getValue(); + if (isBaby) { + metadata.put(EntityData.SCALE, .4f); + metadata.getFlags().setFlag(EntityFlag.BABY, true); + } + } else if (entityMetadata.getId() == 16) { // Update collar color if tamed if (metadata.getFlags().getFlag(EntityFlag.TAMED)) { metadata.put(EntityData.COLOR, collarColor); @@ -76,6 +83,9 @@ public class CatEntity extends TameableEntity { } metadata.put(EntityData.VARIANT, variantColor); } + if (entityMetadata.getId() == 19) { + metadata.getFlags().setFlag(EntityFlag.RESTING, (boolean) entityMetadata.getValue()); + } if (entityMetadata.getId() == 21) { collarColor = (byte) (int) entityMetadata.getValue(); // Needed or else wild cats are a red color