refactor(command): 🚚 move vehicle commands near other moves

Move the following:
- vehicle commands next to other movement related commands like `go`.
- move `ride` / `mount` command functionality into mover plugin
This commit is contained in:
jay 2021-01-26 22:49:23 +05:00
parent 974d460061
commit e6d29576e7
2 changed files with 14 additions and 12 deletions

View File

@ -217,6 +217,16 @@ function command(username, message) {
subcommand("go follow once") subcommand("go follow once")
} }
break; break;
case "ride":
case "mount":
cfg.plugins.mover.command(message_parts)
break
case "unride":
case "getoff":
case "unmount":
case "dismount":
bot.dismount()
break
case "move": case "move":
case "go": case "go":
cfg.plugins.mover.command(message_parts.slice(1), player) cfg.plugins.mover.command(message_parts.slice(1), player)
@ -318,18 +328,6 @@ function command(username, message) {
case "info": case "info":
cfg.plugins.informer.command(message_parts.splice(1)) cfg.plugins.informer.command(message_parts.splice(1))
break break
case "ride":
case "mount":
bot.mount(bot.nearestEntity())
break
case "getoff":
case "unmount":
case "dismount":
bot.dismount()
break
case "go":
bot.moveVehicle(0, 10)
break
// case "use": // case "use":
// bot.useOn(bot.nearestEntity()) // bot.useOn(bot.nearestEntity())
// break; // break;

View File

@ -194,6 +194,10 @@ function command(message_parts, player) {
break break
} }
break break
case "ride":
case "mount":
bot.mount(bot.nearestEntity())
break
case "w": case "w":
case "f": case "f":
command(["forward"].concat(message_parts.slice(1))) command(["forward"].concat(message_parts.slice(1)))