refactor: ♻️ replace add with vec3.offset
This avoids having to import and creat a `new vec3.v()`
This commit is contained in:
@@ -296,7 +296,7 @@ function command(username, message) {
|
||||
switch (message_parts[1]) {
|
||||
case "me":
|
||||
if (player) {
|
||||
bot.lookAt((new v.Vec3(0, 1, 0)).add(player.position))
|
||||
bot.lookAt(player.position.offset(0, 1, 0))
|
||||
} else {
|
||||
cfg.quiet || bot.chat("can't see you")
|
||||
}
|
||||
@@ -313,7 +313,7 @@ function command(username, message) {
|
||||
break
|
||||
default:
|
||||
const aPlayer = bot.players[message_parts[2]] ? bot.players[message_parts[2]].entity : null
|
||||
if (aPlayer) bot.lookAt((new v.Vec3(0, 1, 0)).add(aPlayer.position))
|
||||
if (aPlayer) bot.lookAt(aPlayer.position.offset(0, 1, 0))
|
||||
break;
|
||||
}
|
||||
break
|
||||
@@ -474,7 +474,7 @@ function command(username, message) {
|
||||
case "howdy":
|
||||
case "heyo":
|
||||
case "yo":
|
||||
if (player) bot.lookAt((new v.Vec3(0, 1, 0)).add(player.position))
|
||||
if (player) bot.lookAt(player.position.offset(0, 1, 0))
|
||||
|
||||
// TODO sneak
|
||||
// function swingArm() {
|
||||
|
||||
Reference in New Issue
Block a user