Class ArgumentSerializer<T extends com.mojang.brigadier.arguments.ArgumentType<?>,V>

java.lang.Object
net.darkhax.bookshelf.common.api.commands.args.ArgumentSerializer<T,V>
All Implemented Interfaces:
net.minecraft.commands.synchronization.ArgumentTypeInfo<T,ArgumentSerializer.ArgTemplate<T,V>>

public class ArgumentSerializer<T extends com.mojang.brigadier.arguments.ArgumentType<?>,V> extends Object implements net.minecraft.commands.synchronization.ArgumentTypeInfo<T,ArgumentSerializer.ArgTemplate<T,V>>
  • Constructor Details

    • ArgumentSerializer

      public ArgumentSerializer(com.mojang.serialization.MapCodec<V> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,V> stream, BiFunction<net.minecraft.commands.CommandBuildContext,V,T> mapFunc, Function<T,V> toData)
  • Method Details

    • serializeToNetwork

      public void serializeToNetwork(ArgumentSerializer.ArgTemplate<T,V> template, @NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf)
      Specified by:
      serializeToNetwork in interface net.minecraft.commands.synchronization.ArgumentTypeInfo<T extends com.mojang.brigadier.arguments.ArgumentType<?>,V>
    • deserializeFromNetwork

      @NotNull public @NotNull ArgumentSerializer.ArgTemplate<T,V> deserializeFromNetwork(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf)
      Specified by:
      deserializeFromNetwork in interface net.minecraft.commands.synchronization.ArgumentTypeInfo<T extends com.mojang.brigadier.arguments.ArgumentType<?>,V>
    • serializeToJson

      public void serializeToJson(@NotNull @NotNull ArgumentSerializer.ArgTemplate<T,V> template, @NotNull @NotNull com.google.gson.JsonObject json)
      Specified by:
      serializeToJson in interface net.minecraft.commands.synchronization.ArgumentTypeInfo<T extends com.mojang.brigadier.arguments.ArgumentType<?>,V>
    • unpack

      @NotNull public @NotNull ArgumentSerializer.ArgTemplate<T,V> unpack(@NotNull T t)
      Specified by:
      unpack in interface net.minecraft.commands.synchronization.ArgumentTypeInfo<T extends com.mojang.brigadier.arguments.ArgumentType<?>,V>