Compare commits

...

3 Commits

Author SHA1 Message Date
jay f50e388c39 feat: 🔊 fix path in plugin reload log so that it actually works 3 years ago
jay 135ce6567b fix(mover): 🐛 attempt to fix move while riding vehicle 3 years ago
jay e5803eee59 fix(mover): ✏️ fix missed variable during rename 3 years ago
  1. 2
      lib/index.js
  2. 6
      lib/plugins/mover.js

@ -62,7 +62,7 @@ reloadplugin = (event, filename, pluginpath) => {
console.info(event, filename)
pluginpath = (pluginpath ? pluginpath : './plugins/') + filename
const check = Object.keys(cfg.plugins)
console.info(`reload file:`, pluginpath)
console.info(`reload file: ./lib/${pluginpath}`)
const plugin = require.resolve(pluginpath)
if (plugin && require.cache[plugin]) {
// console.debug(Object.keys(cfg.plugins))

@ -23,7 +23,7 @@ function initMoves(bot = bot, mcData = bot.mcData) {
movements.push(normalMove)
movements.defaultMove = movements[0]
bot.pathfinder.setMovements(defaultMove)
bot.pathfinder.setMovements(normalMove)
}
@ -167,8 +167,8 @@ function moveOrRide(turn = false, reverse = -1, directionLabel, message_parts2)
// bot.once("attach", state = "vehiccel")
if (bot.vehicle) {
// FIXME moveVehicle should be +-1 or 0?
const amount = Math.sign(parseInt(message_parts2[0]) || -reverse)
bot.moveVehicle(turn && amount || 0, !turn && amount || 0)
const amount = parseInt(message_parts2[0]) * -reverse
bot.moveVehicle(turn && Math.sign(amount) || 0, !turn && amount || 0)
} else {
command([directionLabel].concat(message_parts2))
}

Loading…
Cancel
Save