use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class RadioCommand method configAddSong.
@Path("config addSong <radio> <song>")
@Description("Add a song to a radio")
@Permission(Group.ADMIN)
void configAddSong(Radio radio, @Arg(type = RadioSong.class) List<RadioSong> radioSongs) {
for (RadioSong radioSong : radioSongs) config.addSong(radio, radioSong);
configService.save(config);
send(PREFIX + "Added " + radioSongs.stream().map(RadioSong::getName).collect(Collectors.joining(", ")) + " to " + radio.getId());
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class MobHeadCommand method validateTypes.
@Path("validate types")
@Permission(Group.ADMIN)
void validateTypes() {
final List<EntityType> missingTypes = MobHeadType.getMissingTypes();
if (missingTypes.isEmpty()) {
send(PREFIX + "All entity types have defined mob heads");
return;
}
send(PREFIX + "Missing entity types:");
for (EntityType entityType : missingTypes) send(" &e" + camelCase(entityType));
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Halloween20Command method stats.
@Path("stats")
@Permission(Group.ADMIN)
void stats(@Arg("self") OfflinePlayer player) {
Halloween20Service service = new Halloween20Service();
List<Halloween20User> users = service.getAll();
int foundButtons = 0;
int foundButtonsComplete = 0;
int foundPumpkins = 0;
int foundPumpkinsComplete = 0;
int foundComboNumbers = 0;
int foundComboNumbersComplete = 0;
long totalUsers = users.stream().filter(user -> user.getFoundButtons().size() > 0 || user.getFoundPumpkins().size() > 0 || user.getFoundComboLockNumbers().size() > 0).count();
for (Halloween20User user : users) {
foundButtons += user.getFoundButtons().size();
if (user.getFoundButtons().size() == SoundButton.values().length)
++foundButtonsComplete;
foundPumpkins += user.getFoundPumpkins().size();
if (user.getFoundPumpkins().size() == Pumpkin.values().length)
++foundPumpkinsComplete;
foundComboNumbers += user.getFoundComboLockNumbers().size();
if (user.getCombinationStage() == Combination.COMPLETE)
++foundComboNumbersComplete;
}
send("Total users: " + totalUsers);
send("Found Buttons: " + (foundButtons / totalUsers) + " avg, " + foundButtonsComplete + " complete");
send("Found Pumpkins: " + (foundPumpkins / totalUsers) + " avg, " + foundPumpkinsComplete + " complete");
send("Found Combo Numbers: " + (foundComboNumbers / totalUsers) + " avg, " + foundComboNumbersComplete + " complete");
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Halloween20Command method testCombo.
@Path("test combo")
@Permission(Group.ADMIN)
void testCombo() {
Halloween20Service service = new Halloween20Service();
Halloween20User user = service.get(player());
user.getFoundComboLockNumbers().clear();
user.getFoundComboLockNumbers().addAll(Arrays.asList(ComboLockNumber.values()));
service.save(user);
Halloween20Menus.openComboLock(player());
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class TeleportCommand method lock.
@Path("freeze <player> [enable]")
@Permission(Group.ADMIN)
void lock(Player player, Boolean enable) {
UUID uuid = player.getUniqueId();
if (enable == null)
enable = !preventTeleports.contains(uuid);
if (enable) {
preventTeleports.add(uuid);
send(PREFIX + "&cPreventing &3teleports from &e" + player.getName());
} else {
preventTeleports.remove(uuid);
send(PREFIX + "&aAllowing &3teleports from &e" + player.getName());
}
}
Aggregations