2025-08-12 10:39:50 -05:00
|
|
|
class position {
|
2025-05-07 07:27:41 -04:00
|
|
|
constructor(context) {
|
|
|
|
|
const bot = context.bot;
|
|
|
|
|
const config = context.config;
|
|
|
|
|
bot.position = null;
|
2024-07-07 15:44:16 -04:00
|
|
|
|
2025-05-07 07:27:41 -04:00
|
|
|
bot.on("packet.position", (packet) => {
|
|
|
|
|
bot.position = {
|
|
|
|
|
x: packet.x,
|
|
|
|
|
y: packet.y,
|
|
|
|
|
z: packet.z,
|
|
|
|
|
};
|
2024-07-07 15:44:16 -04:00
|
|
|
|
2025-05-07 07:27:41 -04:00
|
|
|
bot._client.write("teleport_confirm", { teleportId: packet.teleportId });
|
2024-07-07 15:44:16 -04:00
|
|
|
|
2025-05-07 07:27:41 -04:00
|
|
|
bot.emit("move");
|
|
|
|
|
});
|
2024-07-07 15:44:16 -04:00
|
|
|
|
2025-05-07 07:27:41 -04:00
|
|
|
bot.on("end", () => {
|
|
|
|
|
bot.position = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-07-07 15:44:16 -04:00
|
|
|
}
|
2025-08-12 10:39:50 -05:00
|
|
|
module.exports = position;
|