Compare commits

...

3 Commits

Author SHA1 Message Date
jay
f50e388c39 feat: 🔊 fix path in plugin reload log so that it actually works 2021-04-14 09:59:48 +05:00
jay
135ce6567b fix(mover): 🐛 attempt to fix move while riding vehicle
Try to give a larger range and more freedom to see if other values work.
Specifically, attempt turning.
No test on vehicles or mobs appear to behave consistently so far.
Tried: pigs, minecarts, horse.
2021-04-14 09:57:36 +05:00
jay
e5803eee59 fix(mover): ✏️ fix missed variable during rename 2021-04-11 23:30:34 +05:00
2 changed files with 4 additions and 4 deletions

View File

@ -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))

View File

@ -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))
}