Update to 1.19.4 & Fix invalid value tooltips

This commit is contained in:
Motschen
2023-05-18 21:33:17 +02:00
parent e9e1bec91f
commit 8109eeb74e
9 changed files with 56 additions and 62 deletions

View File

@@ -80,15 +80,17 @@ public class AutoCommand {
return 0;
}
source.sendFeedback(Text.literal("Successfully set " + entry.getName()+" to "+value), true);
source.sendFeedback(() -> Text.literal("Successfully set " + entry.getName()+" to "+value), true);
return 1;
}
private int getValue(ServerCommandSource source) {
try {
source.sendFeedback(Text.literal("The value of "+entry.getName()+" is "+entry.get(null)), false);
return 1;
}
catch (IllegalAccessException ignored) {}
source.sendFeedback(() -> {
try {
return Text.literal("The value of "+entry.getName()+" is "+entry.get(null));
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}, false);
return 0;
}
}