This commit is contained in:
DoctorMacc 2020-04-09 17:53:38 -04:00
parent 5ecbb49cf8
commit c777641a90
3 changed files with 8 additions and 3 deletions

View file

@ -45,10 +45,11 @@ public class CatEntity extends TameableEntity {
if ((int) entityMetadata.getValue() == 0) { if ((int) entityMetadata.getValue() == 0) {
metadata.put(EntityData.VARIANT, 8); metadata.put(EntityData.VARIANT, 8);
} else if ((int) entityMetadata.getValue() == 8) { } else if ((int) entityMetadata.getValue() == 8) {
// Assumption, need to test
metadata.put(EntityData.VARIANT, 0); metadata.put(EntityData.VARIANT, 0);
} else if ((int) entityMetadata.getValue() == 9) { } else if ((int) entityMetadata.getValue() == 9) {
metadata.put(EntityData.VARIANT, 7); metadata.put(EntityData.VARIANT, 10);
} else if ((int) entityMetadata.getValue() == 10) {
metadata.put(EntityData.VARIANT, 9);
} else { } else {
metadata.put(EntityData.VARIANT, (int) entityMetadata.getValue()); metadata.put(EntityData.VARIANT, (int) entityMetadata.getValue());
} }

View file

@ -46,9 +46,11 @@ public class TameableEntity extends AnimalEntity {
metadata.getFlags().setFlag(EntityFlag.SITTING, (xd & 0x01) == 0x01); metadata.getFlags().setFlag(EntityFlag.SITTING, (xd & 0x01) == 0x01);
metadata.getFlags().setFlag(EntityFlag.ANGRY, (xd & 0x02) == 0x02); metadata.getFlags().setFlag(EntityFlag.ANGRY, (xd & 0x02) == 0x02);
metadata.getFlags().setFlag(EntityFlag.TAMED, (xd & 0x04) == 0x04); metadata.getFlags().setFlag(EntityFlag.TAMED, (xd & 0x04) == 0x04);
// Must be set for wolf collar color to work
// Extending it to all entities to prevent future bugs
if (metadata.getFlags().getFlag(EntityFlag.TAMED)) { if (metadata.getFlags().getFlag(EntityFlag.TAMED)) {
metadata.put(EntityData.OWNER_EID, session.getPlayerEntity().getGeyserId()); metadata.put(EntityData.OWNER_EID, session.getPlayerEntity().getGeyserId());
} } // Can't de-tame an entity so no resetting the owner ID
} }
super.updateBedrockMetadata(entityMetadata, session); super.updateBedrockMetadata(entityMetadata, session);
} }

View file

@ -44,6 +44,8 @@ public class WolfEntity extends TameableEntity {
if (entityMetadata.getId() == 18) { if (entityMetadata.getId() == 18) {
metadata.getFlags().setFlag(EntityFlag.INTERESTED, (boolean) entityMetadata.getValue()); metadata.getFlags().setFlag(EntityFlag.INTERESTED, (boolean) entityMetadata.getValue());
} }
// Wolf collar color
// Relies on EntityData.OWNER_EID being set in TameableEntity.java
if (entityMetadata.getId() == 19) { if (entityMetadata.getId() == 19) {
metadata.put(EntityData.COLOR, (byte) (int) entityMetadata.getValue()); metadata.put(EntityData.COLOR, (byte) (int) entityMetadata.getValue());
} }