Interface IComponentMap
- All Known Implementing Classes:
PatchableComponentMap
,StaticComponentMap
public interface IComponentMap
-
Method Summary
Modifier and TypeMethodDescriptionstatic StaticComponentMap
decode
(NBT nbt, ClientVersion version, IRegistry<? extends ComponentType<?>> registry) static NBT
encode
(StaticComponentMap components, ClientVersion version) <T> T
get
(ComponentType<T> type) default <T> Optional
<T> getOptional
(ComponentType<T> type) default <T> T
getOr
(ComponentType<T> type, T otherValue) boolean
has
(ComponentType<?> type) <T> void
set
(ComponentType<T> type, Optional<T> value) default <T> void
set
(ComponentType<T> type, T value) default <T> void
set
(ComponentValue<T> component) default <T> void
unset
(ComponentType<T> type)
-
Method Details
-
decode
static StaticComponentMap decode(NBT nbt, ClientVersion version, IRegistry<? extends ComponentType<?>> registry) -
encode
-
getOptional
-
has
-
getOr
@Contract("_, !null -> !null") @Nullable default <T> T getOr(ComponentType<T> type, @Nullable T otherValue) -
get
-
set
-
set
-
unset
-
set
-