mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2025-03-01 16:04:57 -05:00
1.20-pre3 and pre4
This commit is contained in:
parent
b9c34476fb
commit
f937d9ba74
3 changed files with 2 additions and 8 deletions
|
@ -199,9 +199,9 @@ public class MinecraftCodec {
|
|||
}
|
||||
|
||||
public static final PacketCodec CODEC = PacketCodec.builder()
|
||||
.protocolVersion((1 << 30) | 135)
|
||||
.protocolVersion((1 << 30) | 137)
|
||||
.helper(() -> new MinecraftCodecHelper(LEVEL_EVENTS, SOUND_NAMES))
|
||||
.minecraftVersion("1.20-pre2")
|
||||
.minecraftVersion("1.20-pre4")
|
||||
.state(ProtocolState.HANDSHAKE, PacketStateCodec.builder()
|
||||
.registerServerboundPacket(0x00, ClientIntentionPacket.class, ClientIntentionPacket::new)
|
||||
)
|
||||
|
|
|
@ -13,17 +13,14 @@ import java.io.IOException;
|
|||
@With
|
||||
@AllArgsConstructor
|
||||
public class ClientboundPlayerCombatEndPacket implements MinecraftPacket {
|
||||
private final int killerId;
|
||||
private final int duration;
|
||||
|
||||
public ClientboundPlayerCombatEndPacket(ByteBuf in, MinecraftCodecHelper helper) throws IOException {
|
||||
this.duration = helper.readVarInt(in);
|
||||
this.killerId = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) throws IOException {
|
||||
helper.writeVarInt(out, this.duration);
|
||||
out.writeInt(this.killerId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,19 +15,16 @@ import java.io.IOException;
|
|||
@AllArgsConstructor
|
||||
public class ClientboundPlayerCombatKillPacket implements MinecraftPacket {
|
||||
private final int playerId;
|
||||
private final int killerId;
|
||||
private final Component message;
|
||||
|
||||
public ClientboundPlayerCombatKillPacket(ByteBuf in, MinecraftCodecHelper helper) throws IOException {
|
||||
this.playerId = helper.readVarInt(in);
|
||||
this.killerId = in.readInt();
|
||||
this.message = helper.readComponent(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf out, MinecraftCodecHelper helper) throws IOException {
|
||||
helper.writeVarInt(out, this.playerId);
|
||||
out.writeInt(this.killerId);
|
||||
helper.writeComponent(out, this.message);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue