Update to 1.19
This commit is contained in:
@@ -13,11 +13,11 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class EnumArgumentType<T extends Enum<?>> implements ArgumentType<T> {
|
||||
private static final DynamicCommandExceptionType NO_SUCH_TYPE = new DynamicCommandExceptionType(o ->
|
||||
new LiteralText(o + " is not a valid argument."));
|
||||
Text.literal(o + " is not a valid argument."));
|
||||
|
||||
private T[] values;
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class EnumStringArgumentType implements ArgumentType<String> {
|
||||
|
||||
private Collection<String> EXAMPLES;
|
||||
private static final DynamicCommandExceptionType INVALID_OPTION = new DynamicCommandExceptionType(name ->
|
||||
new LiteralText(name+" is not a valid option."));
|
||||
Text.literal(name + " is not a valid option."));
|
||||
public EnumStringArgumentType(Collection<String> examples) {
|
||||
this.EXAMPLES = examples;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user