mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2025-02-02 23:31:56 +01:00
fix type
This commit is contained in:
parent
9a3ea9d690
commit
6d7d49fa7b
@ -43,13 +43,15 @@ fun Protocol1_8To1_7_6.registerInventoryPackets() {
|
|||||||
//Set Slot
|
//Set Slot
|
||||||
this.registerClientbound(State.PLAY, 0x2F, 0x2F, object : PacketRemapper() {
|
this.registerClientbound(State.PLAY, 0x2F, 0x2F, object : PacketRemapper() {
|
||||||
override fun registerMap() {
|
override fun registerMap() {
|
||||||
|
map(Type.UNSIGNED_BYTE) // window id
|
||||||
|
map(Type.SHORT) // window type
|
||||||
handler { packetWrapper ->
|
handler { packetWrapper ->
|
||||||
val windowId = packetWrapper.read(Type.BYTE).toShort() //Window Id
|
val windowId = packetWrapper.get(Type.UNSIGNED_BYTE, 0) //Window Id
|
||||||
val windowType = packetWrapper.user().get(Windows::class.java)!!.get(windowId).toShort()
|
val windowType = packetWrapper.user().get(Windows::class.java)!!.get(windowId)
|
||||||
packetWrapper.write(Type.BYTE, windowId.toByte())
|
val slot = packetWrapper.get(Type.SHORT, 0).toInt()
|
||||||
var slot = packetWrapper.read(Type.SHORT).toInt()
|
if (windowType.toInt() == 4 && slot >= 1) {
|
||||||
if (windowType.toInt() == 4 && slot >= 1) slot += 1
|
packetWrapper.set(Type.SHORT, 0, (slot + 1).toShort())
|
||||||
packetWrapper.write(Type.SHORT, slot.toShort()) //Slot
|
}
|
||||||
}
|
}
|
||||||
map(Types1_7_6_10.COMPRESSED_NBT_ITEM, Type.ITEM) //Item
|
map(Types1_7_6_10.COMPRESSED_NBT_ITEM, Type.ITEM) //Item
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user