Skip to content

Commit

Permalink
Bump to 1.21.3 + small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Nov 3, 2024
1 parent b3df351 commit 53dbc06
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public class MinecraftCodec {
public static final PacketCodec CODEC = PacketCodec.builder()
.protocolVersion(768)
.helper(MinecraftCodecHelper::new)
.minecraftVersion("1.21.2")
.minecraftVersion("1.21.3")
.state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder()
.registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new)
)
Expand Down Expand Up @@ -406,7 +406,7 @@ public class MinecraftCodec {
.registerServerboundPacket(ServerboundChatSessionUpdatePacket.class, ServerboundChatSessionUpdatePacket::new)
.registerServerboundPacket(ServerboundChunkBatchReceivedPacket.class, ServerboundChunkBatchReceivedPacket::new)
.registerServerboundPacket(ServerboundClientCommandPacket.class, ServerboundClientCommandPacket::new)
.registerServerboundPacket(ServerboundClientTickEndPacket.class, ServerboundClientTickEndPacket::new)
.registerServerboundPacket(ServerboundClientTickEndPacket.class, (buf, helper) -> ServerboundClientTickEndPacket.INSTANCE)
.registerServerboundPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new)
.registerServerboundPacket(ServerboundCommandSuggestionPacket.class, ServerboundCommandSuggestionPacket::new)
.registerServerboundPacket(ServerboundConfigurationAcknowledgedPacket.class, ServerboundConfigurationAcknowledgedPacket::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ public SlotDisplay readSlotDisplay(ByteBuf buf) {
RecipeSlotType type = RecipeSlotType.from(this.readVarInt(buf));
SlotDisplay display;
switch (type) {
case EMPTY -> display = new EmptySlotDisplay();
case EMPTY -> display = EmptySlotDisplay.INSTANCE;
case ANY_FUEL -> display = new AnyFuelSlotDisplay();
case ITEM -> display = new ItemSlotDisplay(this.readVarInt(buf));
case ITEM_STACK -> display = new ItemStackSlotDisplay(this.readItemStack(buf));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.display.slot;

public record EmptySlotDisplay() implements SlotDisplay {
public static final EmptySlotDisplay INSTANCE = new EmptySlotDisplay();

@Override
public RecipeSlotType getType() {
return RecipeSlotType.EMPTY;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound;

import io.netty.buffer.ByteBuf;
import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.geysermc.mcprotocollib.protocol.codec.MinecraftCodecHelper;
import org.geysermc.mcprotocollib.protocol.codec.MinecraftPacket;

@Data
@NoArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ServerboundClientTickEndPacket implements MinecraftPacket {

public ServerboundClientTickEndPacket(ByteBuf in, MinecraftCodecHelper helper) {
}
public static final ServerboundClientTickEndPacket INSTANCE = new ServerboundClientTickEndPacket();

@Override
public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
Expand Down

0 comments on commit 53dbc06

Please sign in to comment.