Package net.minecraft.core.component
Class PatchedDataComponentMap
java.lang.Object
net.minecraft.core.component.PatchedDataComponentMap
- All Implemented Interfaces:
Iterable<TypedDataComponent<?>>,DataComponentMap
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.core.component.DataComponentMap
DataComponentMap.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> private final DataComponentMapFields inherited from interface net.minecraft.core.component.DataComponentMap
CODEC, EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionPatchedDataComponentMap(DataComponentMap prototype) privatePatchedDataComponentMap(DataComponentMap prototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch, boolean copyOnWtite) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPatch(DataComponentPatch patch) private voidapplyPatch(DataComponentType<?> component, Optional<?> value) asPatch()copy()private voidbooleanstatic PatchedDataComponentMapfromPatch(DataComponentMap prototype, DataComponentPatch patch) <T> Tget(DataComponentType<? extends T> component) inthashCode()booleanprivate static booleanisPatchSanitized(DataComponentMap prototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> map) iterator()Set<DataComponentType<?>> keySet()<T> Tremove(DataComponentType<? extends T> component) voidrestorePatch(DataComponentPatch patch) <T> Tset(DataComponentType<? super T> component, T value) voidsetAll(DataComponentMap map) intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.component.DataComponentMap
filter, getOrDefault, getTyped, has, isEmpty, streamMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
prototype
-
patch
-
copyOnWrite
private boolean copyOnWrite
-
-
Constructor Details
-
PatchedDataComponentMap
-
PatchedDataComponentMap
private PatchedDataComponentMap(DataComponentMap prototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch, boolean copyOnWtite)
-
-
Method Details
-
fromPatch
public static PatchedDataComponentMap fromPatch(DataComponentMap prototype, DataComponentPatch patch) -
isPatchSanitized
private static boolean isPatchSanitized(DataComponentMap prototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> map) -
get
- Specified by:
getin interfaceDataComponentMap
-
set
-
remove
-
applyPatch
-
applyPatch
-
restorePatch
-
setAll
-
ensureMapOwnership
private void ensureMapOwnership() -
keySet
- Specified by:
keySetin interfaceDataComponentMap
-
iterator
- Specified by:
iteratorin interfaceDataComponentMap- Specified by:
iteratorin interfaceIterable<TypedDataComponent<?>>
-
size
public int size()- Specified by:
sizein interfaceDataComponentMap
-
isPatchEmpty
public boolean isPatchEmpty() -
asPatch
-
copy
-
equals
-
hashCode
public int hashCode() -
toString
-