Tnze / go-mc

Collection of Go libraries for Minecraft
https://go-mc.github.io/tutorial/
MIT License
858 stars 115 forks source link

onScreenSlotChange方法的问题 #247

Closed 223225zzzkkk closed 1 year ago

223225zzzkkk commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce

  1. Go Version: 1.20
  2. GoMC Version: 1.19.4
  3. Code: func onScreenSlotChange(id, index int) error { if id == -2 { log.Printf("Slot: inventory: %v", screenManager.Inventory.Slots[index]) } else if id == -1 && index == -1 { log.Printf("Slot: cursor: %v", screenManager.Cursor) } else { container, ok := screenManager.Screens[id] if ok { // Currently, only inventory container is supported switch container.(type) { case screen.Inventory: slot := container.(screen.Inventory).Slots[index] itemInfo := item.ByID[item.ID(slot.ID)] log.Printf("Slot: Screen[%d].Slot[%d]: [%v] * %d | NBT: %v", id, index, itemInfo, slot.Count, slot.NBT) } } } return nil }

Expected output A clear and concise description of what you expected to happen. 物品名称对应不上,数量正确



**Current output**
If applicable, add screenshots to help explain your problem.

**Additional context**

<img width="192" alt="GO" src="https://github.com/Tnze/go-mc/assets/96153949/ccced4dd-6a44-40b6-9413-7c8661c912b2">
<img width="520" alt="SC" src="https://github.com/Tnze/go-mc/assets/96153949/de9854f0-6e4d-422e-966b-77dcf12e70ba">
Tnze commented 1 year ago

因为data/item包没更新了,可以帮忙更新数据试试吗

223225zzzkkk commented 1 year ago

可以, 这个值有木有网站可以看

Tnze commented 1 year ago

你看一下,item包里有个gen的脚本,里面有个数据源url,替换成新的(如果有)再重新生成就可以了。

223225zzzkkk commented 1 year ago

更新好了