use of co.aikar.commands.annotation.CommandPermission in project VoxelGamesLibv2 by VoxelGamesLib.
the class TextureCommands method getById.
@Subcommand("get")
@CommandPermission("%admin")
public void getById(@Nonnull User user, @Nonnull Integer id) {
Lang.msg(user, LangKey.TEXTURE_FETCHING_TEXTURE);
textureHandler.fetchSkin(id, skin -> {
ItemStack skull = textureHandler.getSkull(skin);
user.getPlayer().getInventory().addItem(skull);
Lang.msg(user, LangKey.TEXTURE_TEXTURE_APPLIED);
});
}
use of co.aikar.commands.annotation.CommandPermission 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.CommandPermission 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