Class TagToDataConverter
java.lang.Object
com.blamejared.crafttweaker.api.data.base.converter.tag.TagToDataConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IDataconvert(net.minecraft.nbt.Tag tag) Converts the given Tag to it's IData representation.static MapDataconvertCompound(net.minecraft.nbt.CompoundTag tag) Converts the given CompoundTag to it's MapData representation.static <T extends IData>
TConverst the given Tag to it'sIDatarepresentation.
-
Constructor Details
-
TagToDataConverter
public TagToDataConverter()
-
-
Method Details
-
convert
Converts the given Tag to it's IData representation.- Parameters:
tag- The tag to convert.- Returns:
- The IData representation of the tag.
-
convertTo
@Nullable public static <T extends IData> T convertTo(net.minecraft.nbt.Tag tag, Class<T> clazz) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Converst the given Tag to it'sIDatarepresentation.- Type Parameters:
T- The type of data to convert to.- Parameters:
tag- The tag to convert.clazz- The reified type of T IData to convert to.- Returns:
- The IData representation of the tag.
- Throws:
NoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessException
-
convertCompound
Converts the given CompoundTag to it's MapData representation.- Parameters:
tag- The tag to convert.- Returns:
- The MapData representation of the CompoundTag.
-