mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
aliases, startup NPE, pick option when console
This commit is contained in:
parent
773f24238f
commit
0160d42302
@ -39,7 +39,7 @@ public class CommandIris implements DecreeExecutor {
|
||||
private CommandObject object;
|
||||
private CommandWhat what;
|
||||
|
||||
@Decree(description = "Create a new world", aliases = "+")
|
||||
@Decree(description = "Create a new world", aliases = {"+", "c"})
|
||||
public void create(
|
||||
@Param(aliases = "world-name", description = "The name of the world to create")
|
||||
String name,
|
||||
|
@ -101,7 +101,7 @@ public class CommandObject implements DecreeExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
@Decree(description = "Get a powder that reveals objects", studio = true)
|
||||
@Decree(description = "Get a powder that reveals objects", studio = true, aliases = "d")
|
||||
public void dust() {
|
||||
player().getInventory().addItem(WandSVC.createDust());
|
||||
sender().playSound(Sound.AMBIENT_SOUL_SAND_VALLEY_ADDITIONS, 1f, 1.5f);
|
||||
|
@ -158,8 +158,14 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
}
|
||||
|
||||
KSet<String> m = new KSet<>();
|
||||
KList<File> files = getFolders();
|
||||
|
||||
for (File i : getFolders()) {
|
||||
if (files == null) {
|
||||
possibleKeys = new String[0];
|
||||
return possibleKeys;
|
||||
}
|
||||
|
||||
for (File i : files) {
|
||||
for (File j : matchAllFiles(i, (f) -> f.getName().endsWith(".json"))) {
|
||||
m.add(i.toURI().relativize(j.toURI()).getPath().replaceAll("\\Q.json\\E", ""));
|
||||
}
|
||||
|
@ -513,6 +513,11 @@ public class VirtualDecreeCommand {
|
||||
};
|
||||
|
||||
private String pickValidOption(VolmitSender sender, KList<?> validOptions, DecreeParameterHandler<?> handler, String name, String type) {
|
||||
if (!sender.isPlayer()) {
|
||||
String picked = handler.toStringForce(validOptions.getRandom());
|
||||
sender.sendMessage(C.RED + "We went ahead and picked an option for you: " + picked);
|
||||
return picked;
|
||||
}
|
||||
sender.sendHeader("Pick a " + name + " (" + type + ")");
|
||||
sender.sendMessageRaw("<gradient:#1ed497:#b39427>This query will expire in 15 seconds.</gradient>");
|
||||
String password = UUID.randomUUID().toString().replaceAll("\\Q-\\E", "");
|
||||
|
Loading…
x
Reference in New Issue
Block a user