Compare commits
3 Commits
nogameplay
...
eae4e95803
Author | SHA1 | Date | |
---|---|---|---|
|
eae4e95803 | ||
|
fb066ee8a5 | ||
|
f4445749e6 |
@@ -16,12 +16,18 @@ let movements = []
|
|||||||
|
|
||||||
|
|
||||||
function initMoves(bot = bot, mcData = require('minecraft-data')(bot.version)) {
|
function initMoves(bot = bot, mcData = require('minecraft-data')(bot.version)) {
|
||||||
|
console.info(movements)
|
||||||
|
if (movements.length > 0) {
|
||||||
|
bot.pathfinder.setMovements(defaultMove)
|
||||||
|
return console.warn("movements already initialized!")
|
||||||
|
}
|
||||||
let defaultMove = new Movements(bot, mcData)
|
let defaultMove = new Movements(bot, mcData)
|
||||||
defaultMove.canDig = false
|
defaultMove.canDig = false
|
||||||
defaultMove.scafoldingBlocks.push(mcData.blocksByName.slime_block.id)
|
defaultMove.scafoldingBlocks.push(mcData.blocksByName.slime_block.id)
|
||||||
// defaultMove.blocksCantBreak.add(mcData.blocksByName.glass.id)
|
// defaultMove.blocksCantBreak.add(mcData.blocksByName.glass.id)
|
||||||
// defaultMove.blocksToAvoid.add(mcData.blocksByName.magma.id)
|
// defaultMove.blocksToAvoid.add(mcData.blocksByName.magma.id)
|
||||||
movements.defaultMove = defaultMove
|
movements.push(defaultMove)
|
||||||
|
movements.defaultMove = movements[0]
|
||||||
|
|
||||||
bot.pathfinder.setMovements(defaultMove)
|
bot.pathfinder.setMovements(defaultMove)
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ function sleep(quiet) {
|
|||||||
if (bed && bedstatus == "") {
|
if (bed && bedstatus == "") {
|
||||||
bot.lookAt(bed.position)
|
bot.lookAt(bed.position)
|
||||||
bot.waitForChunksToLoad(() => {
|
bot.waitForChunksToLoad(() => {
|
||||||
cfg.plugins.moveNear(bed.position)
|
cfg.plugins.mover.moveNear(bed.position)
|
||||||
bot.sleep(bed, (err) => {
|
bot.sleep(bed, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
!quiet && bot.chat(`can't sleep: ${err.message}`)
|
!quiet && bot.chat(`can't sleep: ${err.message}`)
|
||||||
|
Reference in New Issue
Block a user