Package com.comphenix.protocol.wrappers
Class WrappedDataWatcher.Registry
java.lang.Object
com.comphenix.protocol.wrappers.WrappedDataWatcher.Registry
- Enclosing class:
- WrappedDataWatcher
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
- Author:
- dmulloy2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromHandle(Object handle)Gets the serializer associated with a given NMS handle.Gets the first serializer associated with a given class.Gets the first serializer associated with a given class and optional state.getBlockDataSerializer(boolean optional)Gets the serializer for BlockDatagetBlockPositionSerializer(boolean optional)Gets the serializer for BlockPositionsGets the serializer for IChatBaseComponentsgetChatComponentSerializer(boolean optional)Gets the serializer for IChatBaseComponentsGets the serializer for DirectionsgetItemStackSerializer(boolean optional)Gets the serializer for ItemStacksGets the serializer for NBT Compound tagsgetUUIDSerializer(boolean optional)Gets the serializer for UUIDsGets the serializer for Vector3Fs
-
Constructor Details
-
Registry
public Registry()
-
-
Method Details
-
get
Gets the first serializer associated with a given class.Note: If
the serializer is optional, values must be wrapped in anOptional.If there are multiple serializers for a given class (i.e. BlockPosition), you should use
get(Class, boolean)for more precision.- Parameters:
clazz- Class to find serializer for- Returns:
- The serializer, or null if none exists
-
get
Gets the first serializer associated with a given class and optional state.Note: If the serializer is optional, values must be wrapped in an
Optional- Parameters:
clazz- Class to find serializer foroptional- Optional state- Returns:
- The serializer, or null if none exists
-
fromHandle
Gets the serializer associated with a given NMS handle.- Parameters:
handle- The handle- Returns:
- The serializer, or null if none exists
-
getChatComponentSerializer
Gets the serializer for IChatBaseComponents- Returns:
- The serializer
-
getChatComponentSerializer
Gets the serializer for IChatBaseComponents- Parameters:
optional- If true, objects must be wrapped in anOptional- Returns:
- The serializer
-
getItemStackSerializer
Gets the serializer for ItemStacks- Parameters:
optional- If true, objects must be wrapped in anOptional- Returns:
- The serializer
-
getBlockDataSerializer
Gets the serializer for BlockData- Parameters:
optional- If true, objects must be wrapped in anOptional- Returns:
- The serializer
-
getVectorSerializer
Gets the serializer for Vector3Fs- Returns:
- The serializer
-
getBlockPositionSerializer
Gets the serializer for BlockPositions- Parameters:
optional- If true, objects must be wrapped in anOptional- Returns:
- The serializer
-
getDirectionSerializer
Gets the serializer for Directions- Returns:
- The serializer
-
getUUIDSerializer
Gets the serializer for UUIDs- Parameters:
optional- If true, objects must be wrapped in anOptional- Returns:
- The serializer
-
getNBTCompoundSerializer
Gets the serializer for NBT Compound tags- Returns:
- The serializer
-