mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Use switch statement for cat variant color
This commit is contained in:
parent
8f735ae453
commit
6359fd4e83
1 changed files with 17 additions and 10 deletions
|
@ -42,17 +42,24 @@ public class CatEntity extends TameableEntity {
|
||||||
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
||||||
if (entityMetadata.getId() == 18) {
|
if (entityMetadata.getId() == 18) {
|
||||||
// Different colors in Java and Bedrock for some reason
|
// Different colors in Java and Bedrock for some reason
|
||||||
if ((int) entityMetadata.getValue() == 0) {
|
int variantColor;
|
||||||
metadata.put(EntityData.VARIANT, 8);
|
switch ((int) entityMetadata.getValue()) {
|
||||||
} else if ((int) entityMetadata.getValue() == 8) {
|
case 0:
|
||||||
metadata.put(EntityData.VARIANT, 0);
|
variantColor = 8;
|
||||||
} else if ((int) entityMetadata.getValue() == 9) {
|
break;
|
||||||
metadata.put(EntityData.VARIANT, 10);
|
case 8:
|
||||||
} else if ((int) entityMetadata.getValue() == 10) {
|
variantColor = 0;
|
||||||
metadata.put(EntityData.VARIANT, 9);
|
break;
|
||||||
} else {
|
case 9:
|
||||||
metadata.put(EntityData.VARIANT, (int) entityMetadata.getValue());
|
variantColor = 10;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
variantColor = 9;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
variantColor = (int) entityMetadata.getValue();
|
||||||
}
|
}
|
||||||
|
metadata.put(EntityData.VARIANT, variantColor);
|
||||||
}
|
}
|
||||||
if (entityMetadata.getId() == 21) {
|
if (entityMetadata.getId() == 21) {
|
||||||
// Needed or else wild cats are a red color
|
// Needed or else wild cats are a red color
|
||||||
|
|
Loading…
Reference in a new issue