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.
This commit is contained in:
jay 2021-04-14 09:57:36 +05:00
parent e5803eee59
commit 135ce6567b

View File

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