net.minecraft.component

public final class MergedComponentMap

implements ComponentMap

net.minecraft.core.component.PatchedDataComponentMap
net.minecraft.class_9335
net.minecraft.component.MergedComponentMap

Field summary

Modifier and TypeField
private final ComponentMap
prototype
field_49654
baseComponents
private it.unimi.dsi.fastutil.objects.Reference2ObjectMap<ComponentType<?>, Optional<?>>
patch
field_49655
changedComponents
private boolean
copyOnWrite
field_49656
copyOnWrite

Constructor summary

ModifierConstructor
public (ComponentMap baseComponents)
private (ComponentMap baseComponents, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<ComponentType<?>, Optional<?>> changedComponents, boolean copyOnWrite)

Method summary

Modifier and TypeMethod
public static MergedComponentMap
fromPatch(DataComponentMap prototype, DataComponentPatch patch)
method_57935(class_9323 arg0, class_9326 arg1)
create(ComponentMap baseComponents, ComponentChanges changes)
private static boolean
isPatchSanitized(DataComponentMap prototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch)
method_57934(class_9323 arg0, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<class_9331<?>, Optional<?>> arg1)
shouldReuseChangesMap(ComponentMap baseComponents, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<ComponentType<?>, Optional<?>> changedComponents)
public <T> T
get(DataComponentType<? extends T> type)
method_58694(class_9331<? extends T> arg0)
get(ComponentType<? extends T> arg0)
public boolean
hasNonDefault(DataComponentType<?> type)
method_65890(class_9331<?> arg0)
hasChanged(ComponentType<?> type)
public <T> T
set(DataComponentType<T> type, T value)
method_57938(class_9331<T> arg0, T arg1)
set(ComponentType<T> type, T value)
public <T> T
set(TypedDataComponent<T> value)
method_74942(class_9336<T> arg0)
set(Component<T> component)
public <T> T
remove(DataComponentType<? extends T> type)
method_57939(class_9331<? extends T> arg0)
remove(ComponentType<? extends T> type)
public void
applyPatch(DataComponentPatch patch)
method_57936(class_9326 arg0)
applyChanges(ComponentChanges changes)
private void
applyPatch(DataComponentType<?> type, Optional<?> value)
method_57937(class_9331<?> arg0, Optional<?> arg1)
applyChange(ComponentType<?> type, Optional<?> optional)
public void
restorePatch(DataComponentPatch patch)
method_59772(class_9326 arg0)
setChanges(ComponentChanges changes)
public void
clearPatch()
method_62714()
clearChanges()
public void
setAll(DataComponentMap components)
method_57933(class_9323 arg0)
setAll(ComponentMap components)
private void
ensureMapOwnership()
method_57942()
onWrite()
public Set<ComponentType<?>>
keySet()
method_57831()
getTypes()
public Iterator<Component<?>>
iterator()
public int
size()
method_57835()
size()
public ComponentChanges
asPatch()
method_57940()
getChanges()
public MergedComponentMap
copy()
method_57941()
copy()
public ComponentMap
toImmutableMap()
method_65769()
immutableCopy()