fix: inventory didn't update after dropping an item
This commit is contained in:
parent
512bc09477
commit
b49e988090
1 changed files with 8 additions and 1 deletions
|
|
@ -353,7 +353,7 @@ contro.on('trigger', ({ command }) => {
|
|||
document.exitPointerLock?.()
|
||||
openPlayerInventory()
|
||||
break
|
||||
case 'general.drop':
|
||||
case 'general.drop': {
|
||||
// if (bot.heldItem/* && ctrl */) bot.tossStack(bot.heldItem)
|
||||
bot._client.write('block_dig', {
|
||||
'status': 4,
|
||||
|
|
@ -365,7 +365,14 @@ contro.on('trigger', ({ command }) => {
|
|||
'face': 0,
|
||||
sequence: 0
|
||||
})
|
||||
const slot = bot.inventory.hotbarStart + bot.quickBarSlot
|
||||
const item = bot.inventory.slots[slot]
|
||||
if (item) {
|
||||
item.count--
|
||||
bot.inventory.updateSlot(slot, item.count > 0 ? item : null!)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'general.chat':
|
||||
showModal({ reactType: 'chat' })
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue