Class ExpandDataComponentPatch

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

@ZenRegister public class ExpandDataComponentPatch extends Object
Stores information about changes that should be made to a DataComponentMap, keeping track of which DataComponentTypes should be added or removed.
  • Nested Class Summary

    Nested Classes
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.core.component.DataComponentPatch.Builder
    Creates a new DataComponentPatch.Builder.
    static <T> net.minecraft.core.component.DataComponentPatch
    forget(net.minecraft.core.component.DataComponentPatch internal, Class<T> tClass, net.minecraft.core.component.DataComponentType<T> component)
    Removes a DataComponentType from the DataComponentPatch.
    static <T> T
    getComponent(net.minecraft.core.component.DataComponentPatch internal, net.minecraft.core.component.DataComponentType<T> type)
    Gets the value for the given DataComponentType.
    static boolean
    isEmpty(net.minecraft.core.component.DataComponentPatch internal)
    Checks if the DataComponentPatch is empty.
    static int
    size(net.minecraft.core.component.DataComponentPatch internal)
    Gets the size of the DataComponentPatch.
    static net.minecraft.core.component.DataComponentPatch.SplitResult
    split(net.minecraft.core.component.DataComponentPatch internal)
    Splits the DataComponentPatch into a DataComponentPatch.SplitResult containing the added and removed DataComponentMaps.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExpandDataComponentPatch

      public ExpandDataComponentPatch()
  • Method Details

    • builder

      public static net.minecraft.core.component.DataComponentPatch.Builder builder()
      Creates a new DataComponentPatch.Builder.
      Returns:
      A new DataComponentPatch.Builder.
    • forget

      public static <T> net.minecraft.core.component.DataComponentPatch forget(net.minecraft.core.component.DataComponentPatch internal, Class<T> tClass, net.minecraft.core.component.DataComponentType<T> component)
      Removes a DataComponentType from the DataComponentPatch.
      Parameters:
      component - The DataComponentType to remove.
      Returns:
      The DataComponentPatch with the DataComponentType removed.
    • isEmpty

      public static boolean isEmpty(net.minecraft.core.component.DataComponentPatch internal)
      Checks if the DataComponentPatch is empty.
      Returns:
      True if the DataComponentPatch is empty, false otherwise.
    • size

      public static int size(net.minecraft.core.component.DataComponentPatch internal)
      Gets the size of the DataComponentPatch.
      Returns:
      The size of the DataComponentPatch.
    • getComponent

      public static <T> T getComponent(net.minecraft.core.component.DataComponentPatch internal, net.minecraft.core.component.DataComponentType<T> type)
      Gets the value for the given DataComponentType.
      Parameters:
      type - The DataComponentType to get the value for.
      Returns:
      The value for the given DataComponentType.
    • split

      public static net.minecraft.core.component.DataComponentPatch.SplitResult split(net.minecraft.core.component.DataComponentPatch internal)
      Splits the DataComponentPatch into a DataComponentPatch.SplitResult containing the added and removed DataComponentMaps.
      Returns:
      A DataComponentPatch.SplitResult containing the added and removed DataComponentMaps.