mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Merge pull request #380 from ForceUpdate1/entity
Fix some entity metadata values
This commit is contained in:
commit
7d52d8aea0
2 changed files with 13 additions and 5 deletions
|
@ -43,10 +43,8 @@ public class AgeableEntity extends CreatureEntity {
|
||||||
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
||||||
if (entityMetadata.getId() == 15) {
|
if (entityMetadata.getId() == 15) {
|
||||||
boolean isBaby = (boolean) entityMetadata.getValue();
|
boolean isBaby = (boolean) entityMetadata.getValue();
|
||||||
if (isBaby) {
|
metadata.put(EntityData.SCALE, isBaby ? .55f : 1f);
|
||||||
metadata.put(EntityData.SCALE, .55f);
|
metadata.getFlags().setFlag(EntityFlag.BABY, isBaby);
|
||||||
metadata.getFlags().setFlag(EntityFlag.BABY, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.updateBedrockMetadata(entityMetadata, session);
|
super.updateBedrockMetadata(entityMetadata, session);
|
||||||
|
|
|
@ -44,9 +44,19 @@ 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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Reset wolf color
|
||||||
|
if (entityMetadata.getId() == 16) {
|
||||||
|
byte xd = (byte) entityMetadata.getValue();
|
||||||
|
boolean angry = (xd & 0x02) == 0x02;
|
||||||
|
if (angry) {
|
||||||
|
metadata.put(EntityData.COLOR, (byte) 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Wolf collar color
|
// Wolf collar color
|
||||||
// Relies on EntityData.OWNER_EID being set in TameableEntity.java
|
// Relies on EntityData.OWNER_EID being set in TameableEntity.java
|
||||||
if (entityMetadata.getId() == 19) {
|
if (entityMetadata.getId() == 19 && !metadata.getFlags().getFlag(EntityFlag.ANGRY)) {
|
||||||
metadata.put(EntityData.COLOR, (byte) (int) entityMetadata.getValue());
|
metadata.put(EntityData.COLOR, (byte) (int) entityMetadata.getValue());
|
||||||
}
|
}
|
||||||
super.updateBedrockMetadata(entityMetadata, session);
|
super.updateBedrockMetadata(entityMetadata, session);
|
||||||
|
|
Loading…
Reference in a new issue