1 package com.irtimaled.bbor.client.commands;
3 import com.mojang.brigadier.context.CommandContext;
4 import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
5 import net.minecraft.command.CommandSource;
6 import net.minecraft.util.text.ITextComponent;
7 import net.minecraft.util.text.TextComponentTranslation;
10 static void feedback(CommandContext<CommandSource> context, String format, Object... values) {
11 context.getSource().sendFeedback(new TextComponentTranslation(format, values), false);
14 static SimpleCommandExceptionType getException(String message, String... values) {
15 ITextComponent textComponent = new TextComponentTranslation(message);
17 int length = values.length;
19 textComponent.appendText(" (");
20 for (int idx = 0; idx < length; idx++) {
21 if (idx > 0) textComponent.appendText(", ");
22 ITextComponent suggestion = new TextComponentTranslation(values[idx]);
23 textComponent.appendSibling(suggestion);
25 textComponent.appendText(")");
27 return new SimpleCommandExceptionType(textComponent);