Bump to 1.21.3 + small optimizations
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
Camotoy 2024-11-02 21:13:31 -04:00
parent b3df3514c9
commit 53dbc06342
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
4 changed files with 8 additions and 7 deletions

View file

@ -216,7 +216,7 @@ public class MinecraftCodec {
public static final PacketCodec CODEC = PacketCodec.builder() public static final PacketCodec CODEC = PacketCodec.builder()
.protocolVersion(768) .protocolVersion(768)
.helper(MinecraftCodecHelper::new) .helper(MinecraftCodecHelper::new)
.minecraftVersion("1.21.2") .minecraftVersion("1.21.3")
.state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder() .state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder()
.registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new) .registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new)
) )
@ -406,7 +406,7 @@ public class MinecraftCodec {
.registerServerboundPacket(ServerboundChatSessionUpdatePacket.class, ServerboundChatSessionUpdatePacket::new) .registerServerboundPacket(ServerboundChatSessionUpdatePacket.class, ServerboundChatSessionUpdatePacket::new)
.registerServerboundPacket(ServerboundChunkBatchReceivedPacket.class, ServerboundChunkBatchReceivedPacket::new) .registerServerboundPacket(ServerboundChunkBatchReceivedPacket.class, ServerboundChunkBatchReceivedPacket::new)
.registerServerboundPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new) .registerServerboundPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new)
.registerServerboundPacket(ServerboundClientTickEndPacket.class, ServerboundClientTickEndPacket::new) .registerServerboundPacket(ServerboundClientTickEndPacket.class, (buf, helper) -> ServerboundClientTickEndPacket.INSTANCE)
.registerServerboundPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new) .registerServerboundPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new)
.registerServerboundPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new) .registerServerboundPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new)
.registerServerboundPacket(ServerboundConfigurationAcknowledgedPacket.class, ServerboundConfigurationAcknowledgedPacket::new) .registerServerboundPacket(ServerboundConfigurationAcknowledgedPacket.class, ServerboundConfigurationAcknowledgedPacket::new)

View file

@ -1099,7 +1099,7 @@ public class MinecraftCodecHelper extends BasePacketCodecHelper {
RecipeSlotType type = RecipeSlotType.from(this.readVarInt(buf)); RecipeSlotType type = RecipeSlotType.from(this.readVarInt(buf));
SlotDisplay display; SlotDisplay display;
switch (type) { switch (type) {
case EMPTY -> display = new EmptySlotDisplay(); case EMPTY -> display = EmptySlotDisplay.INSTANCE;
case ANY_FUEL -> display = new AnyFuelSlotDisplay(); case ANY_FUEL -> display = new AnyFuelSlotDisplay();
case ITEM -> display = new ItemSlotDisplay(this.readVarInt(buf)); case ITEM -> display = new ItemSlotDisplay(this.readVarInt(buf));
case ITEM_STACK -> display = new ItemStackSlotDisplay(this.readItemStack(buf)); case ITEM_STACK -> display = new ItemStackSlotDisplay(this.readItemStack(buf));

View file

@ -1,6 +1,8 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.display.slot; package org.geysermc.mcprotocollib.protocol.data.game.recipe.display.slot;
public record EmptySlotDisplay() implements SlotDisplay { public record EmptySlotDisplay() implements SlotDisplay {
public static final EmptySlotDisplay INSTANCE = new EmptySlotDisplay();
@Override @Override
public RecipeSlotType getType() { public RecipeSlotType getType() {
return RecipeSlotType.EMPTY; return RecipeSlotType.EMPTY;

View file

@ -1,17 +1,16 @@
package org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound; package org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import lombok.AccessLevel;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.geysermc.mcprotocollib.protocol.codec.MinecraftCodecHelper; import org.geysermc.mcprotocollib.protocol.codec.MinecraftCodecHelper;
import org.geysermc.mcprotocollib.protocol.codec.MinecraftPacket; import org.geysermc.mcprotocollib.protocol.codec.MinecraftPacket;
@Data @Data
@NoArgsConstructor @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ServerboundClientTickEndPacket implements MinecraftPacket { public class ServerboundClientTickEndPacket implements MinecraftPacket {
public static final ServerboundClientTickEndPacket INSTANCE = new ServerboundClientTickEndPacket();
public ServerboundClientTickEndPacket(ByteBuf in, MinecraftCodecHelper helper) {
}
@Override @Override
public void serialize(ByteBuf out, MinecraftCodecHelper helper) { public void serialize(ByteBuf out, MinecraftCodecHelper helper) {