Implemented 0x38-ServerboundSetCreativeModeSlotPacket

This commit is contained in:
2026-09-11 01:27:03 +08:00
parent 59189d2fad
commit 8b23fd4383
3 files changed
+30 -4

No files matched your search

+3 -3
View File
@@ -29,7 +29,7 @@ A lightweight minecraft client-side protocol library for Kotlin Native and JVM
- [ ] **Explosion Event Decoder**: Knockback vectors and destroyed block offsets array
- [ ] **Debug Packets Parsing**: Debug subs, block/entity states, and game performance sample events
- [ ] **Particle Parsing**
- [ ] **Slot Data Parsing**
- [x] **Slot Data Codec**
---
@@ -142,9 +142,9 @@ A lightweight minecraft client-side protocol library for Kotlin Native and JVM
- [x] `0x0F` Command Suggestions (`ClientboundCommandSuggestionsPacket`)
- [x] `0x10` Commands (`ClientboundCommandsPacket`)
- [x] `0x11` Container Close (`ClientboundContainerClosePacket`)
- [ ] `0x12` Container Set Content (`ClientboundContainerSetContentPacket`)
- [x] `0x12` Container Set Content (`ClientboundContainerSetContentPacket`)
- [x] `0x13` Container Set Data (`ClientboundContainerSetDataPacket`)
- [ ] `0x14` Container Set Slot (`ClientboundContainerSetSlotPacket`)
- [x] `0x14` Container Set Slot (`ClientboundContainerSetSlotPacket`)
- [x] `0x15` Cookie Request (`ClientboundCookieRequestPacket`)
- [x] `0x16` Cooldown (`ClientboundCooldownPacket`)
- [x] `0x17` Custom Chat Completions (`ClientboundCustomChatCompletionsPacket`)
@@ -0,0 +1,26 @@
/*
* Copyright © 2026 RTAkland
* Author: RTAkland
* Date: 2026/9/11
*/
package cn.rtast.libmc.protocol.packet.play.serverbound
import cn.rtast.libmc.network.BytesBuffer
import cn.rtast.libmc.packet.MinecraftPacket
import cn.rtast.libmc.packet.PacketCodec
import cn.rtast.libmc.protocol.protocol.game.item.slot.Slot
import cn.rtast.libmc.protocol.protocol.game.item.slot.writeSlot
public data class ServerboundSetCreativeModeSlotPacket(val slot: Short, val clickedItem: Slot) : MinecraftPacket {
internal companion object Codec : PacketCodec<ServerboundSetCreativeModeSlotPacket> {
override fun encode(buffer: BytesBuffer, value: ServerboundSetCreativeModeSlotPacket) {
buffer.writeShort(value.slot)
buffer.writeSlot(value.clickedItem)
}
override fun decode(buffer: BytesBuffer): ServerboundSetCreativeModeSlotPacket =
throw UnsupportedOperationException()
}
}
@@ -287,7 +287,7 @@ internal object GamePacketsProtocolRegistry {
register(0x35, ServerboundSetCarriedItemPacket)
register(0x36, ServerboundSetCommandBlockPacket)
register(0x37, ServerboundSetCommandMinecartPacket)
// register(0x38, ServerboundSetCreativeModeSlotPacket)
register(0x38, ServerboundSetCreativeModeSlotPacket)
register(0x39, ServerboundSetGameRulePacket)
register(0x3A, ServerboundSetJigsawBlockPacket)
register(0x3B, ServerboundSetStructureBlockPacket)