Search in sources :

Example 1 with CommandReplacements

use of co.aikar.commands.CommandReplacements in project VoxelGamesLibv2 by VoxelGamesLib.

the class VoxelGamesLib method registerCommandReplacements.

private void registerCommandReplacements() {
    CommandReplacements rep = commandManager.getCommandReplacements();
    rep.addReplacement("@gamemodes", gameHandler.getGameModes().stream().map(GameMode::getName).collect(Collectors.joining("|")));
    rep.addReplacement("@locales", Arrays.stream(Locale.values()).map(locale -> locale.getName() + "|" + locale.getTag()).collect(Collectors.joining("|")));
    rep.addReplacement("@roles", Arrays.stream(Role.values()).map(Role::getName).collect(Collectors.joining("|")));
    rep.addReplacement("@stats", statsHandler.getStatTypes().stream().map(stat -> stat.getPrefix() + ":" + stat.name()).collect(Collectors.joining("|")));
    rep.addReplacement("%user", "voxelgameslib.role.user");
    rep.addReplacement("%premium", "voxelgameslib.role.premium");
    rep.addReplacement("%moderator", "voxelgameslib.role.moderator");
    rep.addReplacement("%admin", "voxelgameslib.role.admin");
}
Also used : Role(com.voxelgameslib.voxelgameslib.role.Role) GameMode(com.voxelgameslib.voxelgameslib.game.GameMode) CommandReplacements(co.aikar.commands.CommandReplacements)

Aggregations

CommandReplacements (co.aikar.commands.CommandReplacements)1 GameMode (com.voxelgameslib.voxelgameslib.game.GameMode)1 Role (com.voxelgameslib.voxelgameslib.role.Role)1