use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Statue20Command method sign.
@Permission(Group.STAFF)
@Path("sign <player>")
void sign(String player) {
Sign sign = getTargetSignRequired();
sign.setLine(0, header);
sign.setLine(1, player);
sign.update();
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class WeeklyWakkaCommand method move.
@Path("move")
@Permission(Group.ADMIN)
public void move() {
List<Warp> warps = WarpType.WEEKLY_WAKKA.getAll();
WeeklyWakkaService service = new WeeklyWakkaService();
WeeklyWakka weeklyWakka = service.get0();
warps.stream().filter(warp -> warp.getName().equals(weeklyWakka.getCurrentLocation())).findFirst().ifPresent(warps::remove);
List<Supplier<JsonBuilder>> newTips = new ArrayList<>();
for (Supplier<JsonBuilder> tip : tips) {
if (weeklyWakka.getCurrentTip() == null) {
newTips.addAll(tips);
break;
}
if (!(tips.indexOf(tip) + "").equals(weeklyWakka.getCurrentTip()))
newTips.add(tip);
}
Supplier<JsonBuilder> newTip = RandomUtils.randomElement(newTips);
Warp newWarp = RandomUtils.randomElement(warps);
weeklyWakka.setCurrentLocation(newWarp.getName());
weeklyWakka.setCurrentTip(String.valueOf(tips.indexOf(newTip)));
weeklyWakka.getFoundPlayers().clear();
service.save(weeklyWakka);
NPC npc = getNPC();
final World world = newWarp.getLocation().getWorld();
final CompletableFuture<Chunk> oldLocation = world.getChunkAtAsync(npc.getStoredLocation());
final CompletableFuture<Chunk> newLocation = world.getChunkAtAsync(newWarp.getLocation());
final Runnable teleport = () -> npc.teleport(newWarp.getLocation(), TeleportCause.PLUGIN);
CompletableFuture.allOf(oldLocation, newLocation).thenRun(teleport);
if (sender() != null)
send(json("The Weekly Wakka NPC has moved to location #" + newWarp.getName()).command("/weeklywakka " + newWarp.getName()));
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class VanishCommand method toggleInteract.
@Path("(ni|nointeract)")
@Permission("pv.use")
void toggleInteract() {
final boolean disabling = player().hasPermission(INTERACT_PERMISSIONS.get(0));
final PermissionChangeBuilder change = disabling ? PermissionChange.unset() : PermissionChange.set();
change.uuid(uuid()).permissions(INTERACT_PERMISSIONS).runAsync().thenRun(() -> send(PREFIX + "Interaction " + (disabling ? "&cdisabled" : "&aenabled")));
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class VanishCommand method fakeJoin.
@Path("(fj|fakejoin)")
@Permission("vanish.fakeannounce")
void fakeJoin() {
JoinQuit.join(player());
new NerdService().edit(nerd(), nerd -> nerd.setLastUnvanish(LocalDateTime.now()));
runCommand("vanish off");
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class DyeStationCommand method dye.
@Path("color <color>")
@Permission(Group.STAFF)
void dye(ChatColor chatColor) {
ItemStack item = getToolRequired();
Colored.of(chatColor.getColor()).apply(item);
}
Aggregations