mineflayer 3.17.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/features.json CHANGED
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "name": "spawner",
9
9
  "description": "spawner is called spawner",
10
- "versions": ["1.13", "1.18.1"]
10
+ "versions": ["1.13", "1.18.2"]
11
11
  },
12
12
  {
13
13
  "name": "blockMetadata",
@@ -17,12 +17,12 @@
17
17
  {
18
18
  "name": "blockStateId",
19
19
  "description": "block metadata is encoded as state id",
20
- "versions": ["1.13", "1.18.1"]
20
+ "versions": ["1.13", "1.18.2"]
21
21
  },
22
22
  {
23
23
  "name": "creativeSleepNearMobs",
24
24
  "description": "can sleep near mobs in creative",
25
- "versions": ["1.13", "1.18.1"]
25
+ "versions": ["1.13", "1.18.2"]
26
26
  },
27
27
  {
28
28
  "name": "fixedPointPosition",
@@ -32,7 +32,7 @@
32
32
  {
33
33
  "name": "doublePosition",
34
34
  "description": "Entity positions are represented with double",
35
- "versions": ["1.9", "1.18.1"]
35
+ "versions": ["1.9", "1.18.2"]
36
36
  },
37
37
  {
38
38
  "name": "fixedPointDelta",
@@ -42,7 +42,7 @@
42
42
  {
43
43
  "name": "fixedPointDelta128",
44
44
  "description": "Delta of position are represented with fixed point numbers times 128",
45
- "versions": ["1.9", "1.18.1"]
45
+ "versions": ["1.9", "1.18.2"]
46
46
  },
47
47
  {
48
48
  "name": "customChannelMCPrefixed",
@@ -52,12 +52,12 @@
52
52
  {
53
53
  "name": "customChannelIdentifier",
54
54
  "description": "custom channel is an identifier starting in minecraft namespace",
55
- "versions": ["1.13", "1.18.1"]
55
+ "versions": ["1.13", "1.18.2"]
56
56
  },
57
57
  {
58
58
  "name": "dimensionDataIsAvailable",
59
59
  "description": "dimensionData is available, providing an additional information about the current dimension",
60
- "versions": ["1.17", "1.18.1"]
60
+ "versions": ["1.17", "1.18.2"]
61
61
  },
62
62
  {
63
63
  "name": "useItemWithBlockPlace",
@@ -67,7 +67,7 @@
67
67
  {
68
68
  "name": "useItemWithOwnPacket",
69
69
  "description": "use item is done with its own packet",
70
- "versions": ["1.9", "1.18.1"]
70
+ "versions": ["1.9", "1.18.2"]
71
71
  },
72
72
  {
73
73
  "name": "blockPlaceHasHeldItem",
@@ -87,7 +87,7 @@
87
87
  {
88
88
  "name": "blockPlaceHasInsideBlock",
89
89
  "description": "block_place packet has inside block",
90
- "versions": ["1.14", "1.18.1"]
90
+ "versions": ["1.14", "1.18.2"]
91
91
  },
92
92
  {
93
93
  "name": "teleportUsesPositionPacket",
@@ -102,7 +102,7 @@
102
102
  {
103
103
  "name": "teleportUsesOwnPacket",
104
104
  "description": "teleport is done using its own packet",
105
- "versions": ["1.9", "1.18.1"]
105
+ "versions": ["1.9", "1.18.2"]
106
106
  },
107
107
  {
108
108
  "name": "oneBlockForSeveralVariations",
@@ -112,7 +112,7 @@
112
112
  {
113
113
  "name": "blockSchemeIsFlat",
114
114
  "description": "all variations of a packet have their own id",
115
- "versions": ["1.13", "1.18.1"]
115
+ "versions": ["1.13", "1.18.2"]
116
116
  },
117
117
  {
118
118
  "name": "tabCompleteHasNoToolTip",
@@ -122,7 +122,7 @@
122
122
  {
123
123
  "name": "tabCompleteHasAToolTip",
124
124
  "description": "tab complete has a tool tip",
125
- "versions": ["1.13", "1.18.1"]
125
+ "versions": ["1.13", "1.18.2"]
126
126
  },
127
127
  {
128
128
  "name": "effectAreMinecraftPrefixed",
@@ -132,7 +132,7 @@
132
132
  {
133
133
  "name": "effectAreNotPrefixed",
134
134
  "description": "effect are not prefixed",
135
- "versions": ["1.13", "1.18.1"]
135
+ "versions": ["1.13", "1.18.2"]
136
136
  },
137
137
  {
138
138
  "name": "itemsAreAlsoBlocks",
@@ -142,12 +142,12 @@
142
142
  {
143
143
  "name": "itemsAreNotBlocks",
144
144
  "description": "items are not block",
145
- "versions": ["1.13", "1.18.1"]
145
+ "versions": ["1.13", "1.18.2"]
146
146
  },
147
147
  {
148
148
  "name": "fishingBobberCorrectlyNamed",
149
149
  "description": "the fishing hook entity is named fishing_bobber",
150
- "versions": ["1.14", "1.18.1"]
150
+ "versions": ["1.14", "1.18.2"]
151
151
  },
152
152
  {
153
153
  "name": "editBookIsPluginChannel",
@@ -157,7 +157,7 @@
157
157
  {
158
158
  "name": "hasEditBookPacket",
159
159
  "description": "book editing is handled through a packet",
160
- "versions": ["1.13", "1.18.1"]
160
+ "versions": ["1.13", "1.18.2"]
161
161
  },
162
162
  {
163
163
  "name": "clientUpdateBookIdWhenSign",
@@ -197,12 +197,12 @@
197
197
  {
198
198
  "name": "dimensionIsAWorld",
199
199
  "description": "description is a world name (string)",
200
- "versions": ["1.16.2", "1.18.1"]
200
+ "versions": ["1.16.2", "1.18.2"]
201
201
  },
202
202
  {
203
203
  "name": "dimensionDataIsAvailable",
204
204
  "description": "dimensionData is available, describing additional dimension information",
205
- "versions": ["1.17", "1.18.1"]
205
+ "versions": ["1.17", "1.18.2"]
206
206
  },
207
207
  {
208
208
  "name": "doesntHaveChestType",
@@ -227,22 +227,22 @@
227
227
  {
228
228
  "name": "hasAttackCooldown",
229
229
  "description": "if there is a cooldown after attacks to deal full damage",
230
- "versions": ["1.9", "1.18.1"]
230
+ "versions": ["1.9", "1.18.2"]
231
231
  },
232
232
  {
233
233
  "name": "usesLoginPacket",
234
234
  "description": "uses the login packet as defined in mcData",
235
- "versions": ["1.16", "1.18.1"]
235
+ "versions": ["1.16", "1.18.2"]
236
236
  },
237
237
  {
238
238
  "name": "usesMultiblockSingleLong",
239
239
  "description": "in the multi_block_change packet is stored as a single number",
240
- "versions": ["1.16.2", "1.18.1"]
240
+ "versions": ["1.16.2", "1.18.2"]
241
241
  },
242
242
  {
243
243
  "name": "usesMultiblock3DChunkCoords",
244
244
  "description": "in the multi_block_change packet, all 3 axis coords are defined",
245
- "versions": ["1.16.2", "1.18.1"]
245
+ "versions": ["1.16.2", "1.18.2"]
246
246
  },
247
247
  {
248
248
  "name": "setBlockUsesMetadataNumber",
@@ -257,7 +257,7 @@
257
257
  {
258
258
  "name": "selectingTradeMovesItems",
259
259
  "description": "selecting a trade automatically puts the required items into trading slots",
260
- "versions": ["1.14", "1.18.1"]
260
+ "versions": ["1.14", "1.18.2"]
261
261
  },
262
262
  {
263
263
  "name": "resourcePackUsesHash",
@@ -272,7 +272,7 @@
272
272
  {
273
273
  "name": "teamUsesChatComponents",
274
274
  "description": "teams use chatcomponents for formatting",
275
- "versions": ["1.13", "1.18.1"]
275
+ "versions": ["1.13", "1.18.2"]
276
276
  },
277
277
  {
278
278
  "name": "teamUsesScoreboard",
@@ -287,7 +287,7 @@
287
287
  {
288
288
  "name": "enderCrystalNameNoCapsWithUnderscore",
289
289
  "description": "this is when the end_crystal's entity name is end_crystal",
290
- "versions": ["1.14", "1.18.1"]
290
+ "versions": ["1.14", "1.18.2"]
291
291
  },
292
292
  {
293
293
  "name": "entityNameUpperCaseNoUnderscore",
@@ -307,7 +307,7 @@
307
307
  {
308
308
  "name": "stateIdUsed",
309
309
  "description": "starting in 1.17.1, actionId has been replaced with stateId",
310
- "versions": ["1.17.1", "1.18.1"]
310
+ "versions": ["1.17.1", "1.18.2"]
311
311
  },
312
312
  {
313
313
  "name": "actionIdUsed",
@@ -317,7 +317,7 @@
317
317
  {
318
318
  "name": "setSlotAsTransaction",
319
319
  "description": "use setslot as transaction instead of just hoping it'll work",
320
- "versions": ["1.17", "1.18.1"]
320
+ "versions": ["1.17", "1.18.2"]
321
321
  },
322
322
  {
323
323
  "name": "armAnimationBeforeUse",
@@ -327,7 +327,7 @@
327
327
  {
328
328
  "name": "tallWorld",
329
329
  "description": "world starts at -64 and ends at 384",
330
- "versions": ["1.18", "1.18.1"]
330
+ "versions": ["1.18", "1.18.2"]
331
331
  },
332
332
  {
333
333
  "name": "sendStringifiedSignText",
@@ -1,5 +1,5 @@
1
1
  const assert = require('assert')
2
- const { callbackify, sleep } = require('../promise_utils')
2
+ const { sleep } = require('../promise_utils')
3
3
  const { once } = require('events')
4
4
 
5
5
  module.exports = inject
@@ -105,11 +105,11 @@ function inject (bot) {
105
105
  await bot.transfer(options)
106
106
  }
107
107
 
108
- anvil.combine = callbackify(combine)
109
- anvil.rename = callbackify(rename)
108
+ anvil.combine = combine
109
+ anvil.rename = rename
110
110
 
111
111
  return anvil
112
112
  }
113
113
 
114
- bot.openAnvil = callbackify(openAnvil)
114
+ bot.openAnvil = openAnvil
115
115
  }
@@ -1,5 +1,4 @@
1
1
  const { Vec3 } = require('vec3')
2
- const { callbackify } = require('../promise_utils')
3
2
 
4
3
  module.exports = inject
5
4
 
@@ -174,7 +173,7 @@ function inject (bot) {
174
173
  })
175
174
 
176
175
  bot.parseBedMetadata = parseBedMetadata
177
- bot.wake = callbackify(wake)
178
- bot.sleep = callbackify(sleep)
176
+ bot.wake = wake
177
+ bot.sleep = sleep
179
178
  bot.isABed = isABed
180
179
  }
@@ -1,7 +1,7 @@
1
1
  const { Vec3 } = require('vec3')
2
2
  const assert = require('assert')
3
3
  const Painting = require('../painting')
4
- const { onceWithCleanup, callbackify } = require('../promise_utils')
4
+ const { onceWithCleanup } = require('../promise_utils')
5
5
 
6
6
  const { OctahedronIterator } = require('prismarine-world').iterators
7
7
 
@@ -548,7 +548,7 @@ function inject (bot, { version, storageBuilder }) {
548
548
  bot.canSeeBlock = canSeeBlock
549
549
  bot.blockAt = blockAt
550
550
  bot._updateBlockState = updateBlockState
551
- bot.waitForChunksToLoad = callbackify(waitForChunksToLoad)
551
+ bot.waitForChunksToLoad = waitForChunksToLoad
552
552
  }
553
553
 
554
554
  function onesInShort (n) {
@@ -1,6 +1,5 @@
1
1
  const assert = require('assert')
2
2
  const { once } = require('events')
3
- const { callbackify } = require('../promise_utils')
4
3
 
5
4
  module.exports = inject
6
5
 
@@ -83,11 +82,11 @@ function inject (bot, { version }) {
83
82
  return book
84
83
  }
85
84
 
86
- bot.writeBook = callbackify(async (slot, pages) => {
85
+ bot.writeBook = async (slot, pages) => {
87
86
  await write(slot, pages, null, null, false)
88
- })
87
+ }
89
88
 
90
- bot.signBook = callbackify(async (slot, pages, author, title) => {
89
+ bot.signBook = async (slot, pages, author, title) => {
91
90
  await write(slot, pages, author, title, true)
92
- })
91
+ }
93
92
  }
@@ -1,5 +1,4 @@
1
1
  const { once } = require('events')
2
- const { printCallbackDepreciation } = require('../promise_utils')
3
2
 
4
3
  module.exports = inject
5
4
 
@@ -170,7 +169,7 @@ function inject (bot, options) {
170
169
  chatWithHeader('', message)
171
170
  }
172
171
 
173
- bot.tabComplete = callbackify(tabComplete)
172
+ bot.tabComplete = tabComplete
174
173
 
175
174
  function addDefaultPatterns () {
176
175
  if (!defaultChatPatterns) return
@@ -194,21 +193,3 @@ function inject (bot, options) {
194
193
  }
195
194
  bot.awaitMessage = awaitMessage
196
195
  }
197
-
198
- function callbackify (f) { // specifically for this function because cb isn't the last parameter
199
- return function (...args) {
200
- const cb = args[1]
201
- args.splice(1, 1)
202
- return f(...args).then(r => {
203
- if (cb) {
204
- printCallbackDepreciation()
205
- cb(undefined, r)
206
- } return r
207
- }, err => {
208
- if (cb) {
209
- printCallbackDepreciation()
210
- cb(err)
211
- } else throw err
212
- })
213
- }
214
- }
@@ -1,4 +1,3 @@
1
- const { callbackify } = require('../promise_utils')
2
1
 
3
2
  module.exports = inject
4
3
 
@@ -26,7 +25,7 @@ function inject (bot) {
26
25
  return chest
27
26
  }
28
27
 
29
- bot.openContainer = callbackify(openContainer)
30
- bot.openChest = callbackify(openContainer)
31
- bot.openDispenser = callbackify(openContainer)
28
+ bot.openContainer = openContainer
29
+ bot.openChest = openContainer
30
+ bot.openDispenser = openContainer
32
31
  }
@@ -1,6 +1,5 @@
1
1
  const assert = require('assert')
2
2
  const { once } = require('events')
3
- const { callbackify } = require('../promise_utils')
4
3
 
5
4
  module.exports = inject
6
5
 
@@ -226,7 +225,7 @@ function inject (bot, { version }) {
226
225
  return true
227
226
  }
228
227
 
229
- bot.craft = callbackify(craft)
228
+ bot.craft = craft
230
229
  bot.recipesFor = recipesFor
231
230
  bot.recipesAll = recipesAll
232
231
  }
@@ -1,6 +1,6 @@
1
1
  const assert = require('assert')
2
2
  const { Vec3 } = require('vec3')
3
- const { callbackify, sleep } = require('../promise_utils')
3
+ const { sleep } = require('../promise_utils')
4
4
  const { once } = require('events')
5
5
 
6
6
  module.exports = inject
@@ -10,8 +10,8 @@ function inject (bot, { version }) {
10
10
 
11
11
  // these features only work when you are in creative mode.
12
12
  bot.creative = {
13
- setInventorySlot: callbackify(setInventorySlot),
14
- flyTo: callbackify(flyTo),
13
+ setInventorySlot: setInventorySlot,
14
+ flyTo: flyTo,
15
15
  startFlying,
16
16
  stopFlying
17
17
  }
@@ -23,7 +23,7 @@ function inject (bot, { version }) {
23
23
  }
24
24
  })
25
25
 
26
- // WARN: This method should not be called twice on the same slot before first callback succeeds
26
+ // WARN: This method should not be called twice on the same slot before first promise succeeds
27
27
  async function setInventorySlot (slot, item) {
28
28
  assert(slot >= 0 && slot <= 44)
29
29
 
@@ -1,5 +1,5 @@
1
1
  const { performance } = require('perf_hooks')
2
- const { createDoneTask, createTask, printCallbackDepreciation } = require('../promise_utils')
2
+ const { createDoneTask, createTask } = require('../promise_utils')
3
3
  const BlockFaces = require('prismarine-world').iterators.BlockFace
4
4
  const { Vec3 } = require('vec3')
5
5
 
@@ -198,35 +198,12 @@ function inject (bot) {
198
198
  return block.digTime(type, creative, bot.entity.isInWater, !bot.entity.onGround, enchantments, bot.entity.effects)
199
199
  }
200
200
 
201
- bot.dig = callbackify(dig)
201
+ bot.dig = dig
202
202
  bot.stopDigging = noop
203
203
  bot.canDigBlock = canDigBlock
204
204
  bot.digTime = digTime
205
205
  }
206
206
 
207
- function callbackify (f) { // specifically for this function because cb could be the non-last parameter
208
- return function (...args) {
209
- const cbIndex = typeof args[1] === 'function' ? 1 : (typeof args[2] === 'function' ? 2 : 3)
210
- const cb = args[cbIndex]
211
-
212
- if (cbIndex === 1) args[1] = true
213
- else if (typeof args[1] === 'string') args[1] = args[1] === 'ignore' ? args[1] : false
214
- else args[1] = !!args[1] // coerce to boolean
215
-
216
- return f(...args).then(r => {
217
- if (cb) {
218
- printCallbackDepreciation()
219
- cb(undefined, r)
220
- } return r
221
- }, err => {
222
- if (cb) {
223
- printCallbackDepreciation()
224
- cb(err)
225
- } else throw err
226
- })
227
- }
228
- }
229
-
230
207
  function noop (err) {
231
208
  if (err) throw err
232
209
  }
@@ -1,6 +1,5 @@
1
1
  const assert = require('assert')
2
2
  const { once } = require('events')
3
- const { callbackify } = require('../promise_utils')
4
3
 
5
4
  module.exports = inject
6
5
 
@@ -15,10 +14,10 @@ function inject (bot) {
15
14
 
16
15
  resetEnchantmentOptions()
17
16
 
18
- enchantmentTable.enchant = callbackify(enchant)
19
- enchantmentTable.takeTargetItem = callbackify(takeTargetItem)
20
- enchantmentTable.putTargetItem = callbackify(putTargetItem)
21
- enchantmentTable.putLapis = callbackify(putLapis)
17
+ enchantmentTable.enchant = enchant
18
+ enchantmentTable.takeTargetItem = takeTargetItem
19
+ enchantmentTable.putTargetItem = putTargetItem
20
+ enchantmentTable.putLapis = putLapis
22
21
  enchantmentTable.targetItem = function () { return this.slots[0] }
23
22
 
24
23
  bot._client.on('craft_progress_bar', onUpdateWindowProperty)
@@ -100,5 +99,5 @@ function inject (bot) {
100
99
  }
101
100
  }
102
101
 
103
- bot.openEnchantmentTable = callbackify(openEnchantmentTable)
102
+ bot.openEnchantmentTable = openEnchantmentTable
104
103
  }
@@ -588,6 +588,7 @@ function inject (bot, { version }) {
588
588
  }
589
589
 
590
590
  function useEntity (target, leftClick, x, y, z) {
591
+ const sneaking = bot.getControlState('sneak')
591
592
  if (x && y && z) {
592
593
  bot._client.write('use_entity', {
593
594
  target: target.id,
@@ -595,13 +596,13 @@ function inject (bot, { version }) {
595
596
  x,
596
597
  y,
597
598
  z,
598
- sneaking: false
599
+ sneaking
599
600
  })
600
601
  } else {
601
602
  bot._client.write('use_entity', {
602
603
  target: target.id,
603
604
  mouse: leftClick,
604
- sneaking: false
605
+ sneaking
605
606
  })
606
607
  }
607
608
  }
@@ -1,5 +1,5 @@
1
1
  const { Vec3 } = require('vec3')
2
- const { callbackify, createDoneTask, createTask } = require('../promise_utils')
2
+ const { createDoneTask, createTask } = require('../promise_utils')
3
3
 
4
4
  module.exports = inject
5
5
 
@@ -54,5 +54,5 @@ function inject (bot) {
54
54
  await fishingTask.promise
55
55
  }
56
56
 
57
- bot.fish = callbackify(fish)
57
+ bot.fish = fish
58
58
  }
@@ -1,5 +1,4 @@
1
1
  const assert = require('assert')
2
- const { callbackify } = require('../promise_utils')
3
2
 
4
3
  module.exports = inject
5
4
 
@@ -25,11 +24,11 @@ function inject (bot) {
25
24
  furnace.totalProgress = null
26
25
  furnace.progress = null
27
26
  furnace.progressSeconds = null
28
- furnace.takeInput = callbackify(takeInput)
29
- furnace.takeFuel = callbackify(takeFuel)
30
- furnace.takeOutput = callbackify(takeOutput)
31
- furnace.putInput = callbackify(putInput)
32
- furnace.putFuel = callbackify(putFuel)
27
+ furnace.takeInput = takeInput
28
+ furnace.takeFuel = takeFuel
29
+ furnace.takeOutput = takeOutput
30
+ furnace.putInput = putInput
31
+ furnace.putFuel = putFuel
33
32
  furnace.inputItem = function () { return this.slots[0] }
34
33
  furnace.fuelItem = function () { return this.slots[1] }
35
34
  furnace.outputItem = function () { return this.slots[2] }
@@ -118,5 +117,5 @@ function inject (bot) {
118
117
  return ticks * 0.05
119
118
  }
120
119
 
121
- bot.openFurnace = callbackify(openFurnace)
120
+ bot.openFurnace = openFurnace
122
121
  }
@@ -1,7 +1,7 @@
1
1
  const assert = require('assert')
2
2
  const { Vec3 } = require('vec3')
3
3
  const { once } = require('events')
4
- const { callbackify, sleep, createDoneTask, createTask, withTimeout } = require('../promise_utils')
4
+ const { sleep, createDoneTask, createTask, withTimeout } = require('../promise_utils')
5
5
 
6
6
  module.exports = inject
7
7
 
@@ -306,36 +306,38 @@ function inject (bot, { version, hideErrors }) {
306
306
  window.emit('close')
307
307
  closeWindow(window)
308
308
  }
309
- window.withdraw = callbackify(async (itemType, metadata, count) => {
309
+
310
+ window.withdraw = async (itemType, metadata, count, nbt) => {
310
311
  if (bot.inventory.emptySlotCount() === 0) {
311
312
  throw new Error('Unable to withdraw, Bot inventory is full.')
312
313
  }
313
-
314
314
  const options = {
315
315
  window,
316
316
  itemType,
317
317
  metadata,
318
318
  count,
319
+ nbt,
319
320
  sourceStart: 0,
320
321
  sourceEnd: window.inventoryStart,
321
322
  destStart: window.inventoryStart,
322
323
  destEnd: window.inventoryEnd
323
324
  }
324
325
  await transfer(options)
325
- })
326
- window.deposit = callbackify(async (itemType, metadata, count) => {
326
+ }
327
+ window.deposit = async (itemType, metadata, count, nbt) => {
327
328
  const options = {
328
329
  window: window,
329
330
  itemType,
330
331
  metadata,
331
332
  count,
333
+ nbt,
332
334
  sourceStart: window.inventoryStart,
333
335
  sourceEnd: window.inventoryEnd,
334
336
  destStart: 0,
335
337
  destEnd: window.inventoryStart
336
338
  }
337
339
  await transfer(options)
338
- })
340
+ }
339
341
  }
340
342
 
341
343
  async function openBlock (block) {
@@ -643,21 +645,21 @@ function inject (bot, { version, hideErrors }) {
643
645
  bot.emit(`setWindowItems:${window.id}`)
644
646
  })
645
647
 
646
- bot.activateBlock = callbackify(activateBlock)
647
- bot.activateEntity = callbackify(activateEntity)
648
- bot.activateEntityAt = callbackify(activateEntityAt)
649
- bot.consume = callbackify(consume)
648
+ bot.activateBlock = activateBlock
649
+ bot.activateEntity = activateEntity
650
+ bot.activateEntityAt = activateEntityAt
651
+ bot.consume = consume
650
652
  bot.activateItem = activateItem
651
653
  bot.deactivateItem = deactivateItem
652
654
 
653
655
  // not really in the public API
654
- bot.clickWindow = callbackify(clickWindow)
656
+ bot.clickWindow = clickWindow
655
657
  bot.putSelectedItemRange = putSelectedItemRange
656
658
  bot.putAway = putAway
657
659
  bot.closeWindow = closeWindow
658
- bot.transfer = callbackify(transfer)
659
- bot.openBlock = callbackify(openBlock)
660
- bot.openEntity = callbackify(openEntity)
661
- bot.moveSlotItem = callbackify(moveSlotItem)
660
+ bot.transfer = transfer
661
+ bot.openBlock = openBlock
662
+ bot.openEntity = openEntity
663
+ bot.moveSlotItem = moveSlotItem
662
664
  bot.updateHeldItem = updateHeldItem
663
665
  }
@@ -3,7 +3,7 @@ const assert = require('assert')
3
3
  const math = require('../math')
4
4
  const conv = require('../conversions')
5
5
  const { performance } = require('perf_hooks')
6
- const { callbackify, createDoneTask, createTask } = require('../promise_utils')
6
+ const { createDoneTask, createTask } = require('../promise_utils')
7
7
 
8
8
  const { Physics, PlayerState } = require('prismarine-physics')
9
9
 
@@ -223,7 +223,7 @@ function inject (bot, { physicsEnabled }) {
223
223
  }
224
224
  })
225
225
 
226
- bot.look = callbackify(async (yaw, pitch, force) => {
226
+ bot.look = async (yaw, pitch, force) => {
227
227
  if (!lookingTask.done) {
228
228
  lookingTask.finish() // finish the previous one
229
229
  }
@@ -245,15 +245,15 @@ function inject (bot, { physicsEnabled }) {
245
245
  }
246
246
 
247
247
  await lookingTask.promise
248
- })
248
+ }
249
249
 
250
- bot.lookAt = callbackify(async (point, force) => {
250
+ bot.lookAt = async (point, force) => {
251
251
  const delta = point.minus(bot.entity.position.offset(0, bot.entity.height, 0))
252
252
  const yaw = Math.atan2(-delta.x, -delta.z)
253
253
  const groundDistance = Math.sqrt(delta.x * delta.x + delta.z * delta.z)
254
254
  const pitch = Math.atan2(delta.y, groundDistance)
255
255
  await bot.look(yaw, pitch, force)
256
- })
256
+ }
257
257
 
258
258
  // player position and look (clientbound)
259
259
  bot._client.on('position', (packet) => {