Skip to content

Commit

Permalink
Fix cats being larger than normal and implement resting (GeyserMC#2238)
Browse files Browse the repository at this point in the history
* Use the correct scale for cats.

* Implement resting
  • Loading branch information
DelxHQ authored May 29, 2021
1 parent 08ba82a commit d80c31f
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public void updateRotation(GeyserSession session, float yaw, float pitch, boolea
@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);
Expand All @@ -76,6 +83,9 @@ public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession s
}
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
Expand Down

0 comments on commit d80c31f

Please sign in to comment.