Class ExpandTypedDataComponent

java.lang.Object
com.blamejared.crafttweaker.natives.component.ExpandTypedDataComponent

@ZenRegister public class ExpandTypedDataComponent extends Object
Holds a DataComponentType and its value.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> void
    applyTo(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass, net.minecraft.core.component.PatchedDataComponentMap patchedMap)
    Applies the TypedDataComponent to a PatchedDataComponentMap.
    static IData
    asIData(net.minecraft.core.component.TypedDataComponent internal)
    Converts the TypedDataComponent to an IData.
    static net.minecraft.resources.ResourceLocation
    getRegistryName(net.minecraft.core.component.TypedDataComponent internal)
    Gets the registry name of the stored DataComponentType.
    static <T> net.minecraft.core.component.TypedDataComponent<T>
    of(Class<T> tClass, net.minecraft.core.component.DataComponentType<T> type, T value)
    Creates a new TypedDataComponent.
    static <T> net.minecraft.core.component.DataComponentType<T>
    type(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass)
    Gets the DataComponentType of the TypedDataComponent.
    static <T> T
    value(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass)
    Gets the value of the TypedDataComponent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 new TypedDataComponent.
      Parameters:
      type - The DataComponentType of 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 the TypedDataComponent to a PatchedDataComponentMap.
      Parameters:
      patchedMap - The PatchedDataComponentMap to apply the TypedDataComponent to.
    • value

      public static <T> T value(net.minecraft.core.component.TypedDataComponent<T> internal, Class<T> tClass)
      Gets the value of the TypedDataComponent.
      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 the DataComponentType of the TypedDataComponent.
      Returns:
      The DataComponentType of the TypedDataComponent.
    • getRegistryName

      public static net.minecraft.resources.ResourceLocation getRegistryName(net.minecraft.core.component.TypedDataComponent internal)
      Gets the registry name of the stored DataComponentType.
      Returns:
      The registry name of the stored DataComponentType.
    • asIData

      public static IData asIData(net.minecraft.core.component.TypedDataComponent internal)
      Converts the TypedDataComponent to an IData.
      Returns:
      The IData representation of the TypedDataComponent.