formatting + make so you can change the main world
This commit is contained in:
parent
4d69c4c696
commit
c31b81133f
5 changed files with 31 additions and 21 deletions
|
|
@ -7,6 +7,7 @@ export default class CommandPlugin extends Plugin {
|
|||
"g",
|
||||
"worlds",
|
||||
"world",
|
||||
"main",
|
||||
];
|
||||
|
||||
constructor(server: Server) {
|
||||
|
|
@ -25,8 +26,14 @@ export default class CommandPlugin extends Plugin {
|
|||
return false;
|
||||
});
|
||||
this.on("command", async (command, player, args) => {
|
||||
if (command == "g") {
|
||||
await server.worlds.find(e => e.name == player.world)!.save();
|
||||
if (command == "main") {
|
||||
await server.worlds.find((e) => e.name == player.world)!.save();
|
||||
|
||||
player.toWorld(
|
||||
server.worlds.find((e) => e.name.toLowerCase() == config.main)!,
|
||||
);
|
||||
} else if (command == "g") {
|
||||
await server.worlds.find((e) => e.name == player.world)!.save();
|
||||
|
||||
const requestedWorld = server.worlds.find((e) =>
|
||||
e.name.toLowerCase() == args.join(" ").toLowerCase()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue