Package me.deecaad.core.utils
Interface MutableRegistry<T extends org.bukkit.Keyed>
- Type Parameters:
T- the type of the entries in the registry
- All Superinterfaces:
Iterable<T>,org.bukkit.Registry<T>
- All Known Implementing Classes:
MutableRegistry.SimpleMutableRegistry
public interface MutableRegistry<T extends org.bukkit.Keyed>
extends org.bukkit.Registry<T>
A mutable
Registry that allows adding and overwriting entries.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classMutableRegistry.SimpleMutableRegistry<T extends org.bukkit.Keyed>A simple implementation ofMutableRegistry, backed by a hash map.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 -
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.bukkit.Registry
get, get, get, getKey, getKeyOrThrow, getOrThrow, getOrThrow, getOrThrow, getTag, getTags, getTagValues, hasTag, keyStream, match, size, stream
-
Method Details
-
add
Tries to add the given entry to the registry. If the entry already exists, aDuplicateRegistryValueExceptionis thrown.- Parameters:
entry- the entry to add- Throws:
DuplicateRegistryValueException- if the entry already exists
-
overwrite
Adds (or, if it already exists, overwrites) the given entry to the registry.- Parameters:
entry- the entry to add
-