use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class HallOfHistoryCommand method create.
@Permission(Group.STAFF)
@Path("create <player>")
void create(@Arg(tabCompleter = Nerd.class) String player) {
runCommand("blockcenter");
String name;
String skin;
try {
Nerd nerd = Nerd.of(convertToOfflinePlayer(player));
name = nerd.getColoredName();
skin = nerd.getName();
} catch (PlayerNotFoundException e) {
// probably a veteran
name = Rank.VETERAN.colored().getHex() + player;
skin = player;
}
// is there a better workaround for this? :P
final String name1 = name;
final String skin1 = skin;
Tasks.wait(5, () -> runCommand("npc create " + name1));
Tasks.wait(10, () -> runCommand("npc skin " + skin1));
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class ItemInfoCommand method extended.
@Path("extended [material]")
@Permission(Group.STAFF)
void extended(Material material) {
ItemStack tool = material == null ? getToolRequired() : new ItemStack(material);
material = tool.getType();
line(5);
sendJson(tool);
line();
send("Namespaced key: " + material.getKey());
send("Blast resistance: " + material.getBlastResistance());
send("Hardness: " + material.getHardness());
send("Max durability: " + material.getMaxDurability());
send("Max stack size: " + material.getMaxStackSize());
line();
send("Has gravity: " + StringUtils.bool(material.hasGravity()));
send("Is air: " + StringUtils.bool(material.isAir()));
send("Is block: " + StringUtils.bool(material.isBlock()));
send("Is burnable: " + StringUtils.bool(material.isBurnable()));
send("Is edible: " + StringUtils.bool(material.isEdible()));
send("Is empty: " + StringUtils.bool(material.isEmpty()));
send("Is flammable: " + StringUtils.bool(material.isFlammable()));
send("Is fuel: " + StringUtils.bool(material.isFuel()));
send("Is interactable: " + StringUtils.bool(material.isInteractable()));
send("Is item: " + StringUtils.bool(material.isItem()));
send("Is occluding: " + StringUtils.bool(material.isOccluding()));
send("Is record: " + StringUtils.bool(material.isRecord()));
send("Is solid: " + StringUtils.bool(material.isSolid()));
send("Is transparent: " + StringUtils.bool(material.isTransparent()));
line();
send("Applicable tags: " + String.join(", ", MaterialTag.getApplicable(material).keySet()));
line();
BlockData blockData = material.createBlockData();
send("BlockData: " + material.data.getSimpleName());
dump(blockData).forEach((method, output) -> send(method + "(): " + output));
line();
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class RanksCommand method bookMenu.
// TODO: Maybe use 1.16 colors to make this look better?
@Path("book")
@Permission(Group.STAFF)
public void bookMenu() {
BookBuilder.WrittenBookMenu bookBuilder = new BookBuilder.WrittenBookMenu();
AtomicReference<JsonBuilder> jsonBuilder = new AtomicReference<>(new JsonBuilder());
jsonBuilder.get().next("Click a rank to view more information.").line();
Arrays.asList(Rank.values()).forEach(rank -> {
if (!rank.isActive())
return;
String formattedRank = rank.getColoredName();
if (rank.equals(Rank.GUEST))
formattedRank = colorize("&8" + rank.getName());
else if (rank.equals(Rank.MEMBER))
formattedRank = colorize("&7" + rank.getName());
jsonBuilder.get().next("&3[+] " + formattedRank);
jsonBuilder.get().command("/" + rank.name().toLowerCase());
if (Rank.of(player()) == rank)
jsonBuilder.get().next(" &0&o<-- You");
jsonBuilder.get().newline().group();
});
bookBuilder.addPage(jsonBuilder.get());
bookBuilder.open(player());
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class MinigamesCommand method mastermindShowAnswer.
@Path("mastermind showAnswer")
@Permission(Group.ADMIN)
void mastermindShowAnswer() {
if (!minigamer.isPlaying(Mastermind.class))
error("You must be playing Mastermind to use this command");
MastermindMatchData matchData = minigamer.getMatch().getMatchData();
send(matchData.getAnswer().toString());
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class MinigamesCommand method refreshNameColors.
@Path("refreshNameColors")
@Permission(PERMISSION_MANAGE)
void refreshNameColors() {
MatchManager.getAll().forEach(match -> {
MinigameScoreboard sb = match.getScoreboard();
if (sb != null) {
sb.update();
send(PREFIX + "Refreshed " + match.getArena().getDisplayName());
}
});
}
Aggregations