Skip to content

Commit

Permalink
Armorstand entity metadata in older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Axionize committed Nov 17, 2024
1 parent 9a0f3a4 commit de7a535
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,18 @@ public void updateEntityMetadata(int entityID, List<EntityData> watchableObjects
Integer attachedEntityID = (Integer) hookWatchableObject.getValue();
((PacketEntityHook) entity).attached = attachedEntityID - 1; // the server adds 1 to the ID
} else if (entity instanceof PacketEntityArmorStand) {
EntityData armorStandByte = WatchableIndexUtil.getIndex(watchableObjects, 15);
int index;
if (PacketEvents.getAPI().getServerManager().getVersion().isOlderThanOrEquals(ServerVersion.V_1_9_4)) {
index = 10;
} else if (PacketEvents.getAPI().getServerManager().getVersion().isOlderThanOrEquals(ServerVersion.V_1_12_2)) {
index = 11;
} else if (PacketEvents.getAPI().getServerManager().getVersion().isOlderThanOrEquals(ServerVersion.V_1_16_5)) {
index = 14;
} else {
index = 15;
}

EntityData armorStandByte = WatchableIndexUtil.getIndex(watchableObjects, index);
if (armorStandByte != null) {
byte info = (Byte) armorStandByte.getValue();

Expand Down

0 comments on commit de7a535

Please sign in to comment.