Skip to content

Commit

Permalink
Fix hitboxes for armor stands (including small ones)
Browse files Browse the repository at this point in the history
  • Loading branch information
Axionize committed Nov 17, 2024
1 parent bfbde9d commit 9a0f3a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ public void updateEntityMetadata(int entityID, List<EntityData> watchableObjects
if (armorStandByte != null) {
byte info = (Byte) armorStandByte.getValue();

entity.isBaby = (info & 0x01) != 0; // technically this is IsSmall which is a different tag, but it has the same effect for us
((PacketEntityArmorStand) entity).isMarker = (info & 0x10) != 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ private static float getWidthMinusBaby(GrimPlayer player, PacketEntity packetEnt
return 1.7f;
} else if (EntityTypes.WIND_CHARGE.equals(type)) {
return 0.3125F;
} else if (EntityTypes.ARMOR_STAND.equals(type)) {
return 0.5F;
}
return 0.6f;
}
Expand Down Expand Up @@ -385,6 +387,8 @@ private static float getHeightMinusBaby(GrimPlayer player, PacketEntity packetEn
return 1.99F;
} else if (EntityTypes.WIND_CHARGE.equals(type)) {
return 0.3125F;
} else if (EntityTypes.ARMOR_STAND.equals(type)) {
return 1.975F;
}
return 1.95f;
}
Expand Down

0 comments on commit 9a0f3a4

Please sign in to comment.