Package net.minecraft.core.component
Class PatchedDataComponentMap
java.lang.Object
net.minecraft.core.component.PatchedDataComponentMap
- All Implemented Interfaces:
Iterable<TypedDataComponent<?>>,DataComponentGetter,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 pPrototype) privatePatchedDataComponentMap(DataComponentMap pPrototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> pPatch, boolean pCopyOnWrite) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPatch(DataComponentPatch pPatch) private voidapplyPatch(DataComponentType<?> pComponent, Optional<?> pValue) asPatch()voidcopy()private voidbooleanstatic PatchedDataComponentMapfromPatch(DataComponentMap pPrototype, DataComponentPatch pPatch) <T> Tget(DataComponentType<? extends T> p_331587_) inthashCode()private static inthashPatch(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch) booleanhasNonDefault(DataComponentType<?> pComponent) booleanprivate static booleanisPatchSanitized(DataComponentMap pPrototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> pMap) iterator()Set<DataComponentType<?>> keySet()<T> Tremove(DataComponentType<? extends T> pComponent) voidrestorePatch(DataComponentPatch pPatch) <T> Tset(DataComponentType<T> pComponent, T pValue) <T> Tset(TypedDataComponent<T> pComponent) voidsetAll(DataComponentMap pMap) intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.component.DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, hasMethods inherited from interface net.minecraft.core.component.DataComponentMap
filter, 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 pPrototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> pPatch, boolean pCopyOnWrite)
-
-
Method Details
-
fromPatch
public static PatchedDataComponentMap fromPatch(DataComponentMap pPrototype, DataComponentPatch pPatch) -
isPatchSanitized
private static boolean isPatchSanitized(DataComponentMap pPrototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> pMap) -
get
- Specified by:
getin interfaceDataComponentGetter
-
hasNonDefault
-
set
-
set
-
remove
-
applyPatch
-
applyPatch
-
restorePatch
-
clearPatch
public void clearPatch() -
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
-
toImmutableMap
-
equals
-
hashCode
public int hashCode() -
hashPatch
private static int hashPatch(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch) -
toString
-