18 lines
532 B
Java
18 lines
532 B
Java
package eu.mhsl.craftattack.worldmuseum.commands;
|
|
|
|
import eu.mhsl.craftattack.worldmuseum.worlds.World;
|
|
import net.minestom.server.command.builder.Command;
|
|
import net.minestom.server.entity.Player;
|
|
|
|
public class SpawnCommand extends Command {
|
|
public SpawnCommand() {
|
|
super("spawn");
|
|
setDefaultExecutor((sender, context) -> {
|
|
Player p = (Player) sender;
|
|
World world = (World) p.getInstance();
|
|
assert world != null;
|
|
p.teleport(world.getSpawn());
|
|
});
|
|
}
|
|
}
|