Fix wolf collar color when it's no longer angry (Closes
@@ -34,6 +34,8 @@ import org.geysermc.connector.network.session.GeyserSession;
public class WolfEntity extends TameableEntity {
+ private byte collarColor;
+
public WolfEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation) {
super(entityId, geyserId, entityType, position, motion, rotation);
}
@@ -57,12 +59,13 @@ public class WolfEntity extends TameableEntity {
// Wolf collar color
// Relies on EntityData.OWNER_EID being set in TameableEntity.java
if (entityMetadata.getId() == 19 && !metadata.getFlags().getFlag(EntityFlag.ANGRY)) {
- metadata.put(EntityData.COLOR, (byte) (int) entityMetadata.getValue());
+ metadata.put(EntityData.COLOR, collarColor = (byte) (int) entityMetadata.getValue());
}
// Wolf anger (1.16+)
if (entityMetadata.getId() == 20) {
metadata.getFlags().setFlag(EntityFlag.ANGRY, (int) entityMetadata.getValue() != 0);
+ metadata.put(EntityData.COLOR, (int) entityMetadata.getValue() != 0 ? (byte) 0 : collarColor);
}
super.updateBedrockMetadata(entityMetadata, session);
