Better context yes

This commit is contained in:
CocoTheOwner 2021-09-07 17:43:13 +02:00
parent a060c01f58
commit f42e418346
3 changed files with 4 additions and 9 deletions

View File

@ -191,8 +191,6 @@ public class CommandIris implements DecreeExecutor {
PlatformChunkGenerator plat = IrisToolbelt.access(player().getWorld()); PlatformChunkGenerator plat = IrisToolbelt.access(player().getWorld());
Engine engine = plat.getEngine(); Engine engine = plat.getEngine();
try { try {
int vd = radius;
int rg = 0;
Chunk cx = player().getLocation().getChunk(); Chunk cx = player().getLocation().getChunk();
KList<Runnable> js = new KList<>(); KList<Runnable> js = new KList<>();
BurstExecutor b = MultiBurst.burst.burst(); BurstExecutor b = MultiBurst.burst.burst();

View File

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

View File

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