3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

Fix cats being larger than normal and implement resting (#2238)

* Use the correct scale for cats.

* Implement resting
Dieser Commit ist enthalten in:
Dylan Ogle 2021-05-29 14:37:03 +01:00 committet von GitHub
Ursprung 08ba82a44e
Commit d80c31f1c2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -49,7 +49,14 @@ public class CatEntity extends TameableEntity {
@Override @Override
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) { public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
super.updateBedrockMetadata(entityMetadata, 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 // Update collar color if tamed
if (metadata.getFlags().getFlag(EntityFlag.TAMED)) { if (metadata.getFlags().getFlag(EntityFlag.TAMED)) {
metadata.put(EntityData.COLOR, collarColor); metadata.put(EntityData.COLOR, collarColor);
@ -76,6 +83,9 @@ public class CatEntity extends TameableEntity {
} }
metadata.put(EntityData.VARIANT, variantColor); metadata.put(EntityData.VARIANT, variantColor);
} }
if (entityMetadata.getId() == 19) {
metadata.getFlags().setFlag(EntityFlag.RESTING, (boolean) entityMetadata.getValue());
}
if (entityMetadata.getId() == 21) { if (entityMetadata.getId() == 21) {
collarColor = (byte) (int) entityMetadata.getValue(); collarColor = (byte) (int) entityMetadata.getValue();
// Needed or else wild cats are a red color // Needed or else wild cats are a red color