Class ArgumentTypes

java.lang.Object
net.minecraft.command.argument.ArgumentTypes

public class ArgumentTypes
extends Object
  • Field Details

  • Constructor Details

    • ArgumentTypes

      public ArgumentTypes()
  • Method Details

    • register

      public static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> void register​(String id, Class<T> class2, ArgumentSerializer<T> argumentSerializer)
      Registers an argument type's serializer.
      Parameters:
      id - the id of the argument type
    • register

      public static void register()
    • byId

      @Nullable private static ArgumentTypes.Entry<?> byId​(Identifier identifier)
    • byClass

      @Nullable private static ArgumentTypes.Entry<?> byClass​(com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
    • toPacket

      public static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> void toPacket​(PacketByteBuf packetByteBuf, T t)
    • fromPacket

      @Nullable public static com.mojang.brigadier.arguments.ArgumentType<?> fromPacket​(PacketByteBuf buf)
    • toJson

      private static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> void toJson​(JsonObject jsonObject, T t)
    • toJson

      public static <S> JsonObject toJson​(com.mojang.brigadier.CommandDispatcher<S> commandDispatcher, com.mojang.brigadier.tree.CommandNode<S> commandNode)
    • hasClass

      public static boolean hasClass​(com.mojang.brigadier.arguments.ArgumentType<?> argumentType)
    • getAllArgumentTypes

      public static <T> Set<com.mojang.brigadier.arguments.ArgumentType<?>> getAllArgumentTypes​(com.mojang.brigadier.tree.CommandNode<T> node)
    • getAllArgumentTypes

      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)