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 boolean
private it.unimi.dsi.fastutil.objects.Reference2ObjectMap
<DataComponentType<?>, Optional<?>> private final DataComponentMap
Fields inherited from interface net.minecraft.core.component.DataComponentMap
CODEC, EMPTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionPatchedDataComponentMap
(DataComponentMap pPrototype) private
PatchedDataComponentMap
(DataComponentMap pPrototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> pPatch, boolean pCopyOnWtite) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyPatch
(DataComponentPatch pPatch) private void
applyPatch
(DataComponentType<?> pComponent, Optional<?> pValue) asPatch()
copy()
private void
boolean
static PatchedDataComponentMap
fromPatch
(DataComponentMap pPrototype, DataComponentPatch pPatch) <T> T
get
(DataComponentType<? extends T> pComponent) int
hashCode()
private static int
hashPatch
(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch) boolean
private static boolean
isPatchSanitized
(DataComponentMap pPrototype, it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> pMap) iterator()
Set
<DataComponentType<?>> keySet()
<T> T
remove
(DataComponentType<? extends T> pComponent) void
restorePatch
(DataComponentPatch pPatch) <T> T
set
(DataComponentType<? super T> pComponent, T pValue) void
setAll
(DataComponentMap pMap) int
size()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.component.DataComponentMap
filter, getOrDefault, getTyped, has, isEmpty, stream
Methods 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 pCopyOnWtite)
-
-
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:
get
in interfaceDataComponentMap
-
set
-
remove
-
applyPatch
-
applyPatch
-
restorePatch
-
setAll
-
ensureMapOwnership
private void ensureMapOwnership() -
keySet
- Specified by:
keySet
in interfaceDataComponentMap
-
iterator
- Specified by:
iterator
in interfaceDataComponentMap
- Specified by:
iterator
in interfaceIterable<TypedDataComponent<?>>
-
size
public int size()- Specified by:
size
in interfaceDataComponentMap
-
isPatchEmpty
public boolean isPatchEmpty() -
asPatch
-
copy
-
equals
-
hashCode
public int hashCode() -
hashPatch
private static int hashPatch(it.unimi.dsi.fastutil.objects.Reference2ObjectMap<DataComponentType<?>, Optional<?>> patch) -
toString
-