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

fix: (spelling) scafold -> scaffold #340

Closed
wants to merge 2 commits into from
Closed
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 examples/movements.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bot.once('spawn', () => {
// To make changes to the behaviour, customize the properties of the instance
customMoves.canDig = false
customMoves.allow1by1towers = false
customMoves.scafoldingBlocks.push(bot.registry.itemsByName.stone.id)
customMoves.scaffoldingBlocks.push(bot.registry.itemsByName.stone.id)
// Thing to note scaffoldingBlocks are an array while other namespaces are usually sets
customMoves.blocksToAvoid.add(bot.registry.blocksByName.carrot.id)

Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ declare module 'mineflayer-pathfinder' {
public carpets: Set<number>
public openable: Set<number>

public scafoldingBlocks: number[];
public scaffoldingBlocks: number[];

public maxDropDown: number;
public infiniteLiquidDropdownDistance: boolean;
Expand Down
10 changes: 5 additions & 5 deletions lib/movements.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class Movements {
this.replaceables.add(registry.blocksByName.water.id)
this.replaceables.add(registry.blocksByName.lava.id)

this.scafoldingBlocks = []
this.scafoldingBlocks.push(registry.itemsByName.dirt.id)
this.scafoldingBlocks.push(registry.itemsByName.cobblestone.id)
this.scaffoldingBlocks = []
this.scaffoldingBlocks.push(registry.itemsByName.dirt.id)
this.scaffoldingBlocks.push(registry.itemsByName.cobblestone.id)

const Block = require('prismarine-block')(bot.registry)
this.fences = new Set()
Expand Down Expand Up @@ -140,7 +140,7 @@ class Movements {
countScaffoldingItems () {
let count = 0
const items = this.bot.inventory.items()
for (const id of this.scafoldingBlocks) {
for (const id of this.scaffoldingBlocks) {
for (const j in items) {
const item = items[j]
if (item.type === id) count += item.count
Expand All @@ -151,7 +151,7 @@ class Movements {

getScaffoldingItem () {
const items = this.bot.inventory.items()
for (const id of this.scafoldingBlocks) {
for (const id of this.scaffoldingBlocks) {
for (const j in items) {
const item = items[j]
if (item.type === id) return item
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ bot.once('spawn', () => {

defaultMove.allow1by1towers = false // Do not build 1x1 towers when going up
defaultMove.canDig = false // Disable breaking of blocks when pathing
defaultMove.scafoldingBlocks.push(bot.registry.itemsByName['netherrack'].id) // Add nether rack to allowed scaffolding items
defaultMove.scaffoldingBlocks.push(bot.registry.itemsByName['netherrack'].id) // Add nether rack to allowed scaffolding items
bot.pathfinder.setMovements(defaultMove) // Update the movement instance pathfinder uses

// Do pathfinder things
Expand Down Expand Up @@ -258,7 +258,7 @@ Set of block id's that are climable. Note: Currently unused as pathfinder cannot
Set of block id's that can be replaced when placing blocks.
* instance of `Set`

### scafoldingBlocks
### scaffoldingBlocks
Array of item id's that can be used as scaffolding blocks.
* Default - `[<scaffoldingItems>]`

Expand Down
Loading