3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-16 04:50:10 +01:00

Only play totem animation for dying player in 1.11->1.10 (#860)

Dieser Commit ist enthalten in:
EnZaXD 2024-08-14 09:38:27 +02:00 committet von GitHub
Ursprung b03be8ecfe
Commit 9c3255d5a4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -83,7 +83,10 @@ public abstract class LegacyEntityRewriter<C extends ClientboundPacketType, T ex
handler(wrapper -> { handler(wrapper -> {
ClientWorld clientChunks = wrapper.user().get(ClientWorld.class); ClientWorld clientChunks = wrapper.user().get(ClientWorld.class);
clientChunks.setEnvironment(wrapper.get(Types.INT, 1)); 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);
}); });
} }
}); });

Datei anzeigen

@ -159,9 +159,15 @@ public class EntityPacketRewriter1_11 extends LegacyEntityRewriter<ClientboundPa
map(Types.BYTE); // 1 - Entity Status map(Types.BYTE); // 1 - Entity Status
handler(wrapper -> { 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.clearPacket();
wrapper.setPacketType(ClientboundPackets1_9_3.GAME_EVENT); wrapper.setPacketType(ClientboundPackets1_9_3.GAME_EVENT);
wrapper.write(Types.UNSIGNED_BYTE, (short) 10); // Play Elder Guardian animation wrapper.write(Types.UNSIGNED_BYTE, (short) 10); // Play Elder Guardian animation