freekin egyptian braces

This commit is contained in:
gnembon committed 2019-06-12 01:03:34 -03:00
1 parent 734dc95dab
commit 9bbaaccb3e
12 files changed
+626 -87

No files matched your search

@@ -149,16 +149,16 @@ public class CarpetCommand
return Messenger.c(args.toArray(new Object[0]));
}
private static BaseText makeSetRuleButton(ParsedRule<?> rule, String option, boolean brackets) {
private static BaseText makeSetRuleButton(ParsedRule<?> rule, String option, boolean brackets)
{
String style = rule.isDefault()?"g":(option.equalsIgnoreCase(rule.defaultAsString)?"y":"e");
if (option.equalsIgnoreCase(rule.defaultAsString))
style = style+"b";
else if (option.equalsIgnoreCase(rule.getAsString()))
style = style+"u";
String baseText = style + (brackets ? " [" : " ") + option + (brackets ? "]" : "");
if (CarpetServer.settingsManager.locked) {
if (CarpetServer.settingsManager.locked)
return Messenger.c(baseText, "^g Settings are locked");
}
if (option.equalsIgnoreCase(rule.getAsString()))
return Messenger.c(baseText);
return Messenger.c(baseText, "^g Switch to " + option, "?/carpet " + rule.name + " " + option);
@@ -200,9 +200,7 @@ public class CarpetCommand
tags.remove(tags.size() - 1);
Messenger.m(player, tags.toArray(new Object[0]));
}
catch (CommandSyntaxException e)
{
}
catch (CommandSyntaxException ignored) { }
return 1;
}
}
@@ -1,5 +1,6 @@
package carpet.commands;
import carpet.CarpetServer;
import carpet.utils.Messenger;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
@@ -15,6 +16,7 @@ public class TestCommand
public static void register(CommandDispatcher<ServerCommandSource> dispatcher)
{
dispatcher.register(literal("test").
then(literal("dump").executes((c) -> CarpetServer.settingsManager.printAllRulesToLog())).
then(argument("first",word()).
executes( (c)-> test(c, getString(c, "first")+" 1"))).
then(argument("second", word()).