Skip to content

Commit

Permalink
Improved Hologram detection method in ArmorStandReplacement
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Sep 23, 2023
1 parent 925484c commit bf359bb
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class ArmorStandReplacement extends EntityReplacement1_7to1_8 {
private double locX, locY, locZ;
private State currentState = null;
private boolean invisible = false;
private boolean nameTagVisible = false;
private String name = null;
private float yaw, pitch;
private float headYaw;
Expand Down Expand Up @@ -117,16 +116,14 @@ public void updateState() {
if (name != null && name.isEmpty()) name = null;
} else if (metadata.id() == 10 && metadata.metaType() == MetaType1_8.Byte) {
armorStandFlags = ((Number) metadata.getValue()).byteValue();
} else if (metadata.id() == 3 && metadata.metaType() == MetaType1_8.Byte) {
nameTagVisible = ((Number) metadata.getValue()).byteValue() != 0;
}
}
invisible = (flags & 0x20) != 0;
small = (armorStandFlags & 0x01) != 0;
marker = (armorStandFlags & 0x10) != 0;

State prevState = currentState;
if (invisible && marker) {
if (invisible && (name != null || marker)) {
currentState = State.HOLOGRAM;
} else {
currentState = State.ZOMBIE;
Expand Down

0 comments on commit bf359bb

Please sign in to comment.