mirror of
https://github.com/PrismarineJS/prismarine-web-client.git
synced 2025-02-17 15:50:14 -05:00
Update index.js (#25)
This commit is contained in:
parent
6cc708775e
commit
3471c284e7
1 changed files with 4 additions and 3 deletions
7
index.js
7
index.js
|
@ -119,11 +119,12 @@ async function main () {
|
|||
}
|
||||
}, false)
|
||||
document.addEventListener('mousedown', (e) => {
|
||||
let ButtonBlock
|
||||
if (bot.canDigBlock(bot.blockAtCursor())) ButtonBlock = bot.blockAtCursor()
|
||||
const ButtonBlock = bot.blockAtCursor()
|
||||
if (!ButtonBlock) return
|
||||
if (e.button === 0) {
|
||||
bot.dig(ButtonBlock)
|
||||
if (bot.canDigBlock(ButtonBlock)) {
|
||||
bot.dig(ButtonBlock)
|
||||
}
|
||||
} else if (e.button === 2) {
|
||||
const vecArray = [new Vec3(0, -1, 0), new Vec3(0, 1, 0), new Vec3(0, 0, -1), new Vec3(0, 0, 1), new Vec3(-1, 0, 0), new Vec3(1, 0, 0)]
|
||||
const vec = vecArray[ButtonBlock.face]
|
||||
|
|
Loading…
Reference in a new issue