public class ArgumentTypes extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ArgumentTypes.Entry<T extends com.mojang.brigadier.arguments.ArgumentType<?>> |
Modifier and Type | Field and Description |
---|---|
private static Map<Class<?>,ArgumentTypes.Entry<?>> |
classMap |
private static Map<Identifier,ArgumentTypes.Entry<?>> |
idMap |
private static Logger |
LOGGER |
Constructor and Description |
---|
ArgumentTypes() |
Modifier and Type | Method and Description |
---|---|
private static ArgumentTypes.Entry<?> |
byClass(com.mojang.brigadier.arguments.ArgumentType<?> argumentType) |
private static ArgumentTypes.Entry<?> |
byId(Identifier identifier) |
static com.mojang.brigadier.arguments.ArgumentType<?> |
fromPacket(PacketByteBuf buf) |
static <T> Set<com.mojang.brigadier.arguments.ArgumentType<?>> |
getAllArgumentTypes(com.mojang.brigadier.tree.CommandNode<T> node) |
private static <T> void |
getAllArgumentTypes(com.mojang.brigadier.tree.CommandNode<T> node,
Set<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypes,
Set<com.mojang.brigadier.tree.CommandNode<T>> ignoredNodes) |
static boolean |
hasClass(com.mojang.brigadier.arguments.ArgumentType<?> argumentType) |
static void |
register() |
static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> |
register(String id,
Class<T> class2,
ArgumentSerializer<T> argumentSerializer)
Registers an argument type's serializer.
|
static <S> JsonObject |
toJson(com.mojang.brigadier.CommandDispatcher<S> commandDispatcher,
com.mojang.brigadier.tree.CommandNode<S> commandNode) |
private static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> |
toJson(JsonObject jsonObject,
T t) |
static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> |
toPacket(PacketByteBuf packetByteBuf,
T t) |
private static final Logger LOGGER
private static final Map<Class<?>,ArgumentTypes.Entry<?>> classMap
private static final Map<Identifier,ArgumentTypes.Entry<?>> idMap
public static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> void register(String id, Class<T> class2, ArgumentSerializer<T> argumentSerializer)
id
- the id of the argument typepublic static void register()
@Nullable private static ArgumentTypes.Entry<?> byId(Identifier identifier)
@Nullable private static ArgumentTypes.Entry<?> byClass(com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
public static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> void toPacket(PacketByteBuf packetByteBuf, T t)
@Nullable public static com.mojang.brigadier.arguments.ArgumentType<?> fromPacket(PacketByteBuf buf)
private static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> void toJson(JsonObject jsonObject, T t)
public static <S> JsonObject toJson(com.mojang.brigadier.CommandDispatcher<S> commandDispatcher, com.mojang.brigadier.tree.CommandNode<S> commandNode)
public static boolean hasClass(com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
public static <T> Set<com.mojang.brigadier.arguments.ArgumentType<?>> getAllArgumentTypes(com.mojang.brigadier.tree.CommandNode<T> node)