use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class WorldCommands method tp.
@Subcommand("tp")
@CommandPermission("%admin")
@Syntax("<world> - the name of the world to tp to")
@Description("Teleports you to a world")
public void tp(@Nonnull User sender, @Nonnull String world) {
Optional<Map> o = handler.getMap(world);
if (o.isPresent()) {
Map map = o.get();
sender.getPlayer().teleport(map.getCenter().toLocation(map.getLoadedName(sender.getUuid())));
} else {
World w = Bukkit.getWorld(world);
if (w != null) {
sender.getPlayer().teleport(Bukkit.getWorld(world).getSpawnLocation());
}
Lang.msg(sender, LangKey.WORLD_UNKNOWN_MAP, world);
}
}
use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class EditMode method chest.
@Subcommand("chest")
@CommandPermission("%admin")
@Syntax("<name> - the name of the chest")
public void chest(@Nonnull User sender, @Nonnull String name) {
if (editMode.contains(sender.getUuid())) {
ItemStack chest = new ItemBuilder(Material.CHEST).name(name).build();
sender.getPlayer().getInventory().setItemInMainHand(chest);
} else {
Lang.msg(sender, LangKey.EDITMODE_NOT_ENABLED);
}
}
Aggregations