[pick pr?] fix some bugs?

This commit is contained in:
Vitaly 2023-08-09 19:34:09 +03:00
commit 73ef18fdae
3 changed files with 4 additions and 4 deletions

View file

@ -361,10 +361,10 @@ async function connect (options) {
bot.setControlState('jump', true)
break
case 'KeyD':
bot.setControlState('left', true)
bot.setControlState('right', true)
break
case 'KeyA':
bot.setControlState('right', true)
bot.setControlState('left', true)
break
case 'KeyS':
bot.setControlState('back', true)

View file

@ -69,7 +69,7 @@ class BossBar extends LitElement {
setTitle (bar) {
if (bar._title.text) this.title = bar._title.text
else this.title = translations[this._title.translate] || 'Unkown Entity'
else this.title = translations[this._title.translate] || 'Unknown Entity'
}
setColor (bar) {

View file

@ -116,7 +116,7 @@ class Hotbar extends LitElement {
})
document.addEventListener('keydown', (e) => {
const numPressed = e.code.substr(5)
const numPressed = +(e.code.match(/Digit(\d)/)?.[1] ?? -1)
if (numPressed < 1 || numPressed > 9) return
this.reloadHotbarSelected(numPressed - 1)
})