Skip to content

Commit

Permalink
Replace openChest with openContainer in docs and examples (#2656)
Browse files Browse the repository at this point in the history
  • Loading branch information
slightly-imperfect committed Jun 13, 2022
1 parent 8531cc4 commit fc75883
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ See [prismarine-recipe](https://github.com/PrismarineJS/prismarine-recipe)
### mineflayer.Container

Extends windows.Window for chests, dispensers, etc...
See `bot.openChest(chestBlock or minecartchestEntity)`.
See `bot.openContainer(chestBlock or minecartchestEntity)`.

### mineflayer.Furnace

Expand Down
2 changes: 1 addition & 1 deletion docs/es/api_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Mira [prismarine-recipe](https://github.com/PrismarineJS/prismarine-recipe)
### mineflayer.Container

Extiende windows.Window para cofres, dispensadores, etc...
Mira `bot.openChest(chestBlock o minecartchestEntity)`.
Mira `bot.openContainer(chestBlock o minecartchestEntity)`.

### mineflayer.Furnace

Expand Down
4 changes: 2 additions & 2 deletions docs/ru/api_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
### mineflayer.Chest

Предоставляет сеанс взаимодействия с сундуками ( Открытие и закрытие )
Смотрите `bot.openChest(chestBlock or minecartchestEntity)`.
Смотрите `bot.openContainer(chestBlock or minecartchestEntity)`.

#### chest.window

Expand Down Expand Up @@ -1490,7 +1490,7 @@ bot.once('login', () => {

#### bot.openChest(chestBlock or minecartchestEntity)

Открывает сундук
Устарело.Открывает сундук. Такой же как "openContainer"

#### bot.openFurnace(furnaceBlock)

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ See [prismarine-recipe](https://github.com/PrismarineJS/prismarine-recipe)
### mineflayer.Container

Extends windows.Window for chests, dispensers, etc...
See `bot.openChest(chestBlock or minecartchestEntity)`.
See `bot.openContainer(chestBlock or minecartchestEntity)`.

### mineflayer.Furnace

Expand Down
2 changes: 1 addition & 1 deletion examples/chest.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function watchChest (minecart, blocks = []) {
return
}
}
const chest = await bot.openChest(chestToOpen)
const chest = await bot.openContainer(chestToOpen)
sayItems(chest.containerItems())
chest.on('updateSlot', (slot, oldItem, newItem) => {
bot.chat(`chest update: ${itemToString(oldItem)} -> ${itemToString(newItem)} (slot: ${slot})`)
Expand Down
6 changes: 3 additions & 3 deletions test/externalTests/useChests.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = () => async (bot) => {
}

async function depositBones (chestLocation, count) {
const chest = await bot.openChest(bot.blockAt(chestLocation))
const chest = await bot.openContainer(bot.blockAt(chestLocation))
assert(chest.containerItems().length === 0)
assert(chest.items().length > 0)
const name = 'bone'
Expand All @@ -52,7 +52,7 @@ module.exports = () => async (bot) => {
}

async function withdrawBones (chestLocation, count) {
const chest = await bot.openChest(bot.blockAt(chestLocation))
const chest = await bot.openContainer(bot.blockAt(chestLocation))
const name = 'bone'
const item = itemByName(chest.containerItems(), name)
if (!item) {
Expand Down Expand Up @@ -109,7 +109,7 @@ module.exports = () => async (bot) => {
chest.close()
}
}
const chest = await bot.openChest(bot.blockAt(largeChestLocations[0]))
const chest = await bot.openContainer(bot.blockAt(largeChestLocations[0]))
await once(chest, 'close')

await depositBones(smallChestLocation, 1)
Expand Down

0 comments on commit fc75883

Please sign in to comment.