9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 19:19:07 +00:00

Merge pull request #599 from CocoTheOwner/Fixes

aliases, startup NPE, pick option when console
This commit is contained in:
Dan
2021-09-09 08:22:05 -04:00
committed by GitHub
8 changed files with 26 additions and 26 deletions

View File

@@ -460,7 +460,7 @@ public class VirtualDecreeCommand {
value = update;
}
if (i.isContextual() && value == null) {
if (sender.isPlayer() && i.isContextual() && value == null) {
DecreeContextHandler<?> ch = DecreeContextHandler.contextHandlers.get(i.getType());
if (ch != null) {

View File

@@ -543,30 +543,26 @@ public class VolmitSender implements CommandSender {
String nHoverTitle = p.getNames().convert((ff) -> "<#d665f0>" + ff).toString(", ");
String nDescription = "<#3fe05a>✎ <#6ad97d><font:minecraft:uniform>" + p.getDescription();
String nUsage;
String context = "";
if (p.isRequired()) {
String fullTitle;
if (p.isContextual() && isPlayer()) {
fullTitle = "<#ffcc00>[" + nTitle + "<#ffcc00>] ";
nUsage = "<#ff9900>➱ <#ffcc00><font:minecraft:uniform>The value may be derived from environment context.";
} else if (p.isRequired()) {
fullTitle = "<red>[" + nTitle + "<red>] ";
nUsage = "<#db4321>⚠ <#faa796><font:minecraft:uniform>This parameter is required.";
} else if (p.hasDefault()) {
fullTitle = "<#4f4f4f>⊰" + nTitle + "<#4f4f4f>⊱";
nUsage = "<#2181db>✔ <#78dcf0><font:minecraft:uniform>Defaults to \"" + p.getParam().defaultValue() + "\" if undefined.";
} else {
fullTitle = "<#4f4f4f>⊰" + nTitle + "<#4f4f4f>⊱";
nUsage = "<#a73abd>✔ <#78dcf0><font:minecraft:uniform>This parameter is optional.";
}
if (p.isContextual()) {
context = "<#ff9900>➱ <#ffcc00><font:minecraft:uniform>The value may be derived from environment context" + newline;
}
String type = "<#cc00ff>✢ <#ff33cc><font:minecraft:uniform>This parameter is of type " + p.getType().getSimpleName();
String fullTitle;
if (p.isRequired()) {
fullTitle = "<red>[" + nTitle + "<red>] ";
} else {
fullTitle = "<#4f4f4f>⊰" + nTitle + "<#4f4f4f>⊱";
}
String type = "<#cc00ff>✢ <#ff33cc><font:minecraft:uniform>This parameter is of type " + p.getType().getSimpleName() + ".";
nodes
.append("<hover:show_text:'")
.append(nHoverTitle).append(newline)
.append(nDescription).append(newline)
.append(context)
.append(nUsage).append(newline)
.append(type)
.append("'>")