[ci skip] Fix player combat packet value comments (#4013)

This commit is contained in:
EnZaXD 2024-07-13 10:59:47 +02:00 committed by GitHub
parent 20f7738f08
commit c59c15d6f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -63,7 +63,7 @@ public final class Protocol1_19_4To1_20 extends AbstractProtocol<ClientboundPack
wrapper.read(Types.INT); // Killer ID
});
registerClientbound(ClientboundPackets1_19_4.PLAYER_COMBAT_KILL, wrapper -> {
wrapper.passthrough(Types.VAR_INT); // Duration
wrapper.passthrough(Types.VAR_INT); // Player ID
wrapper.read(Types.INT); // Killer ID
});
}

View File

@ -258,7 +258,7 @@ public final class Protocol1_20_2To1_20_3 extends AbstractProtocol<ClientboundPa
registerClientbound(ClientboundPackets1_20_2.PLAYER_COMBAT_KILL, new PacketHandlers() {
@Override
public void register() {
map(Types.VAR_INT); // Duration
map(Types.VAR_INT); // Player ID
handler(wrapper -> convertComponent(wrapper));
}
});

View File

@ -85,8 +85,8 @@ public class ComponentRewriter<C extends ClientboundPacketType> implements com.v
public void registerPlayerCombat(final C packetType) {
protocol.registerClientbound(packetType, wrapper -> {
if (wrapper.passthrough(Types.VAR_INT) == 2) {
wrapper.passthrough(Types.VAR_INT);
wrapper.passthrough(Types.INT);
wrapper.passthrough(Types.VAR_INT); // Player ID
wrapper.passthrough(Types.INT); // Killer ID
processText(wrapper.user(), wrapper.passthrough(Types.COMPONENT));
}
});
@ -142,8 +142,8 @@ public class ComponentRewriter<C extends ClientboundPacketType> implements com.v
protocol.registerClientbound(packetType, new PacketHandlers() {
@Override
public void register() {
map(Types.VAR_INT);
map(Types.INT);
map(Types.VAR_INT); // Player ID
map(Types.INT); // Killer ID
handler(wrapper -> processText(wrapper.user(), wrapper.passthrough(Types.COMPONENT)));
}
});
@ -153,7 +153,7 @@ public class ComponentRewriter<C extends ClientboundPacketType> implements com.v
protocol.registerClientbound(packetType, new PacketHandlers() {
@Override
public void register() {
map(Types.VAR_INT); // Duration
map(Types.VAR_INT); // Player ID
handler(wrapper -> passthroughAndProcess(wrapper));
}
});