Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving #2593. Change mineflayer.container docs to reference openContainer not openChest and updated examples. #2656

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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