Class CommonPacketCodec
java.lang.Object
dev.munebase.dynamickeybinds.network.CommonPacketCodec
Shared packet serialization helpers used by both loader networking layers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AddKeybindPacketdecodeAddKeybind(net.minecraft.network.FriendlyByteBuf buf) Decodes an add keybind packet from the buffer.static RemoveKeybindPacketdecodeRemoveKeybind(net.minecraft.network.FriendlyByteBuf buf) Decodes a remove keybind packet from the buffer.static SyncKeybindsPacketdecodeSyncKeybinds(net.minecraft.network.FriendlyByteBuf buf) Decodes a sync keybinds packet from the buffer.static UpdateKeybindPacketdecodeUpdateKeybind(net.minecraft.network.FriendlyByteBuf buf) Decodes an update keybind packet from the buffer.static voidencodeAddKeybind(AddKeybindPacket pkt, net.minecraft.network.FriendlyByteBuf buf) Encodes an add keybind packet into the buffer.static voidencodeRemoveKeybind(RemoveKeybindPacket pkt, net.minecraft.network.FriendlyByteBuf buf) Encodes a remove keybind packet into the buffer.static voidencodeSyncKeybinds(net.minecraft.network.FriendlyByteBuf buf, List<StoredKeybind> keybinds) Encodes a list of keybinds into the buffer.static voidencodeUpdateKeybind(UpdateKeybindPacket pkt, net.minecraft.network.FriendlyByteBuf buf) Encodes an update keybind packet into the buffer.
-
Method Details
-
decodeSyncKeybinds
Decodes a sync keybinds packet from the buffer.- Parameters:
buf- The buffer to read from- Returns:
- The decoded packet
-
encodeSyncKeybinds
public static void encodeSyncKeybinds(net.minecraft.network.FriendlyByteBuf buf, List<StoredKeybind> keybinds) Encodes a list of keybinds into the buffer.- Parameters:
buf- The buffer to write tokeybinds- The keybinds to encode
-
decodeAddKeybind
Decodes an add keybind packet from the buffer.- Parameters:
buf- The buffer to read from- Returns:
- The decoded packet
-
encodeAddKeybind
public static void encodeAddKeybind(AddKeybindPacket pkt, net.minecraft.network.FriendlyByteBuf buf) Encodes an add keybind packet into the buffer.- Parameters:
pkt- The packet to encodebuf- The buffer to write to
-
decodeRemoveKeybind
Decodes a remove keybind packet from the buffer.- Parameters:
buf- The buffer to read from- Returns:
- The decoded packet
-
encodeRemoveKeybind
public static void encodeRemoveKeybind(RemoveKeybindPacket pkt, net.minecraft.network.FriendlyByteBuf buf) Encodes a remove keybind packet into the buffer.- Parameters:
pkt- The packet to encodebuf- The buffer to write to
-
decodeUpdateKeybind
Decodes an update keybind packet from the buffer.- Parameters:
buf- The buffer to read from- Returns:
- The decoded packet
-
encodeUpdateKeybind
public static void encodeUpdateKeybind(UpdateKeybindPacket pkt, net.minecraft.network.FriendlyByteBuf buf) Encodes an update keybind packet into the buffer.- Parameters:
pkt- The packet to encodebuf- The buffer to write to
-