Package me.deecaad.core.utils
Class MutableRegistry.SimpleMutableRegistry<T extends org.bukkit.Keyed>
java.lang.Object
me.deecaad.core.utils.MutableRegistry.SimpleMutableRegistry<T>
- Type Parameters:
T- the type of the entries in the registry
- All Implemented Interfaces:
Iterable<T>,MutableRegistry<T>,org.bukkit.Registry<T>
- Enclosing interface:
MutableRegistry<T extends org.bukkit.Keyed>
public static final class MutableRegistry.SimpleMutableRegistry<T extends org.bukkit.Keyed>
extends Object
implements MutableRegistry<T>
A simple implementation of
MutableRegistry, backed by a hash map.-
Nested Class Summary
Nested classes/interfaces inherited from interface me.deecaad.core.utils.MutableRegistry
MutableRegistry.SimpleMutableRegistry<T extends org.bukkit.Keyed>Nested classes/interfaces inherited from interface org.bukkit.Registry
org.bukkit.Registry.NotARegistry<A extends org.bukkit.Keyed>, org.bukkit.Registry.SimpleRegistry<T extends Enum<T> & org.bukkit.Keyed> -
Field Summary
Fields inherited from interface org.bukkit.Registry
ADVANCEMENT, ART, ATTRIBUTE, BANNER_PATTERN, BIOME, BLOCK, BOSS_BARS, CAT_VARIANT, DAMAGE_TYPE, DATA_COMPONENT_TYPE, EFFECT, ENCHANTMENT, ENTITY_TYPE, FLUID, FROG_VARIANT, GAME_EVENT, GAME_RULE, INSTRUMENT, ITEM, JUKEBOX_SONG, LOOT_TABLES, MAP_DECORATION_TYPE, MATERIAL, MEMORY_MODULE_TYPE, MENU, MOB_EFFECT, PARTICLE_TYPE, POTION, POTION_EFFECT_TYPE, SOUND_EVENT, SOUNDS, STATISTIC, STRUCTURE, STRUCTURE_TYPE, TRIM_MATERIAL, TRIM_PATTERN, VILLAGER_PROFESSION, VILLAGER_TYPE, WOLF_VARIANT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTries to add the given entry to the registry.get(@NotNull org.bukkit.NamespacedKey namespacedKey) @Nullable org.bukkit.NamespacedKeygetOrThrow(@NotNull org.bukkit.NamespacedKey namespacedKey) io.papermc.paper.registry.tag.Tag<T> Collection<io.papermc.paper.registry.tag.Tag<T>> getTags()booleaniterator()Stream<org.bukkit.NamespacedKey> Returns a new stream, which contains all registry keys, which are registered to the registry.voidAdds (or, if it already exists, overwrites) the given entry to the registry.intsize()Gets the size of the registry.stream()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.bukkit.Registry
get, get, getKeyOrThrow, getOrThrow, getOrThrow, getTagValues, match
-
Constructor Details
-
SimpleMutableRegistry
-
-
Method Details
-
get
- Specified by:
getin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
getKey
- Specified by:
getKeyin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
hasTag
- Specified by:
hasTagin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
getTag
- Specified by:
getTagin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
getTags
- Specified by:
getTagsin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
getOrThrow
- Specified by:
getOrThrowin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
stream
- Specified by:
streamin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>
-
keyStream
Returns a new stream, which contains all registry keys, which are registered to the registry.- Specified by:
keyStreamin interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>- Returns:
- a stream of all registry keys
-
size
public int size()Gets the size of the registry.- Specified by:
sizein interfaceorg.bukkit.Registry<T extends org.bukkit.Keyed>- Returns:
- the size of the registry
-
iterator
-
add
Description copied from interface:MutableRegistryTries to add the given entry to the registry. If the entry already exists, aDuplicateRegistryValueExceptionis thrown.- Specified by:
addin interfaceMutableRegistry<T extends org.bukkit.Keyed>- Parameters:
entry- the entry to add- Throws:
DuplicateRegistryValueException- if the entry already exists
-
overwrite
Description copied from interface:MutableRegistryAdds (or, if it already exists, overwrites) the given entry to the registry.- Specified by:
overwritein interfaceMutableRegistry<T extends org.bukkit.Keyed>- Parameters:
entry- the entry to add
-