Class WrappedDataWatcher.Registry

java.lang.Object
com.comphenix.protocol.wrappers.WrappedDataWatcher.Registry
Enclosing class:
WrappedDataWatcher

public static class WrappedDataWatcher.Registry extends Object
Represents a DataWatcherRegistry containing the supported WrappedDataWatcher.Serializers in 1.9.
  • Byte
  • Integer
  • Float
  • String
  • IChatBaseComponent
  • ItemStack
  • Optional<IBlockData>
  • Boolean
  • Vector3f
  • BlockPosition
  • Optional<BlockPosition>
  • EnumDirection
  • Optional<UUID>
  • NBTTagCompound
  • Constructor Details

    • Registry

      public Registry()
  • Method Details

    • get

      @Deprecated(forRemoval=true) public static WrappedDataWatcher.Serializer get(Class<?> clazz)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use get(Type) instead.
    • get

      public static WrappedDataWatcher.Serializer get(Type type)
      Gets the first serializer associated with a given type.

      Note: If the serializer is optional, values must be wrapped in an Optional.

      If there are multiple serializers for a given class (i.e. BlockPosition), you should use get(Class, boolean) for more precision.

      Parameters:
      type - Type to find serializer for
      Returns:
      The serializer, or null if none exists
    • get

      @Deprecated(forRemoval=true) public static WrappedDataWatcher.Serializer get(Class<?> clazz, boolean optional)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use get(Type, boolean) instead.
    • get

      public static WrappedDataWatcher.Serializer get(Type type, boolean optional)
      Gets the first serializer associated with a given type and optional state.
      Note: If the serializer is optional, values must be wrapped in an Optional
      Parameters:
      type - Type to find serializer for
      optional - Optional state
      Returns:
      The serializer, or null if none exists
    • fromHandle

      public static WrappedDataWatcher.Serializer fromHandle(Object handle)
      Gets the serializer associated with a given NMS handle.
      Parameters:
      handle - The handle
      Returns:
      The serializer, or null if none exists
    • getChatComponentSerializer

      public static WrappedDataWatcher.Serializer getChatComponentSerializer()
      Gets the serializer for IChatBaseComponents
      Returns:
      The serializer
    • getChatComponentSerializer

      public static WrappedDataWatcher.Serializer getChatComponentSerializer(boolean optional)
      Gets the serializer for IChatBaseComponents
      Parameters:
      optional - If true, objects must be wrapped in an Optional
      Returns:
      The serializer
    • getItemStackSerializer

      public static WrappedDataWatcher.Serializer getItemStackSerializer(boolean optional)
      Gets the serializer for ItemStacks
      Parameters:
      optional - If true, objects must be wrapped in an Optional
      Returns:
      The serializer
    • getBlockDataSerializer

      public static WrappedDataWatcher.Serializer getBlockDataSerializer(boolean optional)
      Gets the serializer for BlockData
      Parameters:
      optional - If true, objects must be wrapped in an Optional
      Returns:
      The serializer
    • getVectorSerializer

      public static WrappedDataWatcher.Serializer getVectorSerializer()
      Gets the serializer for Vector3Fs
      Returns:
      The serializer
    • getBlockPositionSerializer

      public static WrappedDataWatcher.Serializer getBlockPositionSerializer(boolean optional)
      Gets the serializer for BlockPositions
      Parameters:
      optional - If true, objects must be wrapped in an Optional
      Returns:
      The serializer
    • getDirectionSerializer

      public static WrappedDataWatcher.Serializer getDirectionSerializer()
      Gets the serializer for Directions
      Returns:
      The serializer
    • getUUIDSerializer

      public static WrappedDataWatcher.Serializer getUUIDSerializer(boolean optional)
      Gets the serializer for UUIDs
      Parameters:
      optional - If true, objects must be wrapped in an Optional
      Returns:
      The serializer
    • getNBTCompoundSerializer

      public static WrappedDataWatcher.Serializer getNBTCompoundSerializer()
      Gets the serializer for NBT Compound tags
      Returns:
      The serializer