Class ExpandDataComponentPatch
java.lang.Object
com.blamejared.crafttweaker.natives.component.ExpandDataComponentPatch
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 ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.core.component.DataComponentPatch.Builderbuilder()Creates a newDataComponentPatch.Builder.static <T> net.minecraft.core.component.DataComponentPatchforget(net.minecraft.core.component.DataComponentPatch internal, Class<T> tClass, net.minecraft.core.component.DataComponentType<T> component) Removes aDataComponentTypefrom theDataComponentPatch.static <T> TgetComponent(net.minecraft.core.component.DataComponentPatch internal, net.minecraft.core.component.DataComponentType<T> type) Gets the value for the givenDataComponentType.static booleanisEmpty(net.minecraft.core.component.DataComponentPatch internal) Checks if theDataComponentPatchis empty.static intsize(net.minecraft.core.component.DataComponentPatch internal) Gets the size of theDataComponentPatch.static net.minecraft.core.component.DataComponentPatch.SplitResultsplit(net.minecraft.core.component.DataComponentPatch internal) Splits theDataComponentPatchinto aDataComponentPatch.SplitResultcontaining the added and removedDataComponentMaps.
-
Constructor Details
-
ExpandDataComponentPatch
public ExpandDataComponentPatch()
-
-
Method Details
-
builder
public static net.minecraft.core.component.DataComponentPatch.Builder builder()Creates a newDataComponentPatch.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 aDataComponentTypefrom theDataComponentPatch.- Parameters:
component- TheDataComponentTypeto remove.- Returns:
- The
DataComponentPatchwith theDataComponentTyperemoved.
-
isEmpty
public static boolean isEmpty(net.minecraft.core.component.DataComponentPatch internal) Checks if theDataComponentPatchis empty.- Returns:
- True if the
DataComponentPatchis empty, false otherwise.
-
size
public static int size(net.minecraft.core.component.DataComponentPatch internal) Gets the size of theDataComponentPatch.- 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 givenDataComponentType.- Parameters:
type- TheDataComponentTypeto 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 theDataComponentPatchinto aDataComponentPatch.SplitResultcontaining the added and removedDataComponentMaps.- Returns:
- A
DataComponentPatch.SplitResultcontaining the added and removedDataComponentMaps.
-