Class ExpandTypedDataComponent
java.lang.Object
com.blamejared.crafttweaker.natives.component.ExpandTypedDataComponent
Holds a
DataComponentType and its value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidapplyTo(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass, net.minecraft.core.component.PatchedDataComponentMap patchedMap) Applies theTypedDataComponentto aPatchedDataComponentMap.static IDataasIData(net.minecraft.core.component.TypedDataComponent internal) Converts theTypedDataComponentto anIData.static net.minecraft.resources.ResourceLocationgetRegistryName(net.minecraft.core.component.TypedDataComponent internal) Gets the registry name of the storedDataComponentType.static <T> net.minecraft.core.component.TypedDataComponent<T> Creates a newTypedDataComponent.static <T> net.minecraft.core.component.DataComponentType<T> Gets theDataComponentTypeof theTypedDataComponent.static <T> TGets the value of theTypedDataComponent.
-
Constructor Details
-
ExpandTypedDataComponent
public ExpandTypedDataComponent()
-
-
Method Details
-
of
public static <T> net.minecraft.core.component.TypedDataComponent<T> of(Class<T> tClass, net.minecraft.core.component.DataComponentType<T> type, T value) Creates a newTypedDataComponent.- Parameters:
type- TheDataComponentTypeof the component.value- The value of the component.- Returns:
- A new
TypedDataComponent.
-
applyTo
public static <T> void applyTo(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass, net.minecraft.core.component.PatchedDataComponentMap patchedMap) Applies theTypedDataComponentto aPatchedDataComponentMap.- Parameters:
patchedMap- ThePatchedDataComponentMapto apply theTypedDataComponentto.
-
value
public static <T> T value(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass) Gets the value of theTypedDataComponent.- Returns:
- The value of the
TypedDataComponent.
-
type
public static <T> net.minecraft.core.component.DataComponentType<T> type(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass) Gets theDataComponentTypeof theTypedDataComponent.- Returns:
- The
DataComponentTypeof theTypedDataComponent.
-
getRegistryName
public static net.minecraft.resources.ResourceLocation getRegistryName(net.minecraft.core.component.TypedDataComponent internal) Gets the registry name of the storedDataComponentType.- Returns:
- The registry name of the stored
DataComponentType.
-
asIData
Converts theTypedDataComponentto anIData.- Returns:
- The
IDatarepresentation of theTypedDataComponent.
-