Skip to content

Commit

Permalink
Only play totem animation for dying player in 1.11->1.10 (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Aug 14, 2024
1 parent b03be8e commit 9c3255d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ public void register() {
handler(wrapper -> {
ClientWorld clientChunks = wrapper.user().get(ClientWorld.class);
clientChunks.setEnvironment(wrapper.get(Types.INT, 1));
addTrackedEntity(wrapper, wrapper.get(Types.INT, 0), playerType);

final int entityId = wrapper.get(Types.INT, 0);
addTrackedEntity(wrapper, entityId, playerType);
tracker(wrapper.user()).setClientEntityId(entityId);
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,15 @@ public void register() {
map(Types.BYTE); // 1 - Entity Status

handler(wrapper -> {
byte b = wrapper.get(Types.BYTE, 0);
final int entityId = wrapper.get(Types.INT, 0);
if (entityId != tracker(wrapper.user()).clientEntityId()) {
// Entity events are sent for all players, but we only want to apply this for the self player
return;
}

if (b == 35) {
final byte entityStatus = wrapper.get(Types.BYTE, 0);
if (entityStatus == 35) {
// TODO spawn particles?
wrapper.clearPacket();
wrapper.setPacketType(ClientboundPackets1_9_3.GAME_EVENT);
wrapper.write(Types.UNSIGNED_BYTE, (short) 10); // Play Elder Guardian animation
Expand Down

0 comments on commit 9c3255d

Please sign in to comment.