(window)
| 344 | } |
| 345 | |
| 346 | function extendWindow (window) { |
| 347 | window.close = () => { |
| 348 | closeWindow(window) |
| 349 | window.emit('close') |
| 350 | } |
| 351 | |
| 352 | window.withdraw = async (itemType, metadata, count, nbt) => { |
| 353 | if (bot.inventory.emptySlotCount() === 0) { |
| 354 | throw new Error('Unable to withdraw, Bot inventory is full.') |
| 355 | } |
| 356 | const options = { |
| 357 | window, |
| 358 | itemType, |
| 359 | metadata, |
| 360 | count, |
| 361 | nbt, |
| 362 | sourceStart: 0, |
| 363 | sourceEnd: window.inventoryStart, |
| 364 | destStart: window.inventoryStart, |
| 365 | destEnd: window.inventoryEnd |
| 366 | } |
| 367 | await transfer(options) |
| 368 | } |
| 369 | window.deposit = async (itemType, metadata, count, nbt) => { |
| 370 | const options = { |
| 371 | window, |
| 372 | itemType, |
| 373 | metadata, |
| 374 | count, |
| 375 | nbt, |
| 376 | sourceStart: window.inventoryStart, |
| 377 | sourceEnd: window.inventoryEnd, |
| 378 | destStart: 0, |
| 379 | destEnd: window.inventoryStart |
| 380 | } |
| 381 | await transfer(options) |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | async function openBlock (block, direction, cursorPos) { |
| 386 | bot.activateBlock(block, direction, cursorPos) |
no test coverage detected
searching dependent graphs…