Package org.bukkit
Interface Registry<T extends Keyed>
- Type Parameters:
T
- type of item in the registry
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
Registry.SimpleRegistry
Represents a registry of Bukkit objects that may be retrieved by
NamespacedKey
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Registry.SimpleRegistry<T extends Enum<T> & Keyed>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Registry
<Advancement> Server advancements.Server art.Attribute.static final Registry
<PatternType> Server banner patterns.Server biomes.Server block types.static final Registry
<KeyedBossBar> Custom boss bars.Server cat types.static final Registry
<DamageType> Damage types.static final Registry
<PotionEffectType> Server mob effects.static final Registry
<Enchantment> Server enchantments.static final Registry
<EntityType> Server entity types.Server fluids.static final Registry
<Frog.Variant> Frog variants.Game events.static final Registry
<MusicInstrument> Server instruments.Server item types.static final Registry
<JukeboxSong> Jukebox songs.static final Registry
<LootTables> Default server loot tables.static final Registry
<MapCursor.Type> Map cursor types.Server materials.Memory Keys.Server menus.Server particles.static final Registry
<PotionType> Server potions.Sound keys.Server statistics.Server structures.static final Registry
<StructureType> Server structure types.static final Registry
<TrimMaterial> Trim materials.static final Registry
<TrimPattern> Trim patterns.static final Registry
<Villager.Profession> Villager profession.static final Registry
<Villager.Type> Villager type.static final Registry
<Wolf.Variant> Wolf variants. -
Method Summary
Modifier and TypeMethodDescriptionget
(NamespacedKey key) Get the object by its key.getOrThrow
(NamespacedKey key) Get the object by its key.default T
Attempts to match the registered object with the given key.stream()
Returns a new stream, which contains all registry items, which are registered to the registry.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
ADVANCEMENT
Server advancements.- See Also:
-
ART
Server art.- See Also:
-
ATTRIBUTE
Attribute.- See Also:
-
BANNER_PATTERN
Server banner patterns.- See Also:
-
BIOME
Server biomes.- See Also:
-
BLOCK
Server block types.- See Also:
- API Note:
- BlockType is not ready for public usage yet
-
BOSS_BARS
Custom boss bars.- See Also:
-
CAT_VARIANT
Server cat types.- See Also:
-
ENCHANTMENT
Server enchantments.- See Also:
-
ENTITY_TYPE
Server entity types.- See Also:
-
INSTRUMENT
Server instruments.- See Also:
-
ITEM
Server item types.- See Also:
- API Note:
- ItemType is not ready for public usage yet
-
LOOT_TABLES
Default server loot tables.- See Also:
-
MATERIAL
Server materials.- See Also:
-
MENU
Server menus.- See Also:
-
EFFECT
Server mob effects.- See Also:
-
PARTICLE_TYPE
Server particles.- See Also:
-
POTION
Server potions.- See Also:
-
STATISTIC
Server statistics.- See Also:
-
STRUCTURE
Server structures.- See Also:
-
STRUCTURE_TYPE
Server structure types.- See Also:
-
SOUNDS
Sound keys.- See Also:
-
TRIM_MATERIAL
Trim materials.- See Also:
-
TRIM_PATTERN
Trim patterns.- See Also:
-
DAMAGE_TYPE
Damage types.- See Also:
-
JUKEBOX_SONG
Jukebox songs.- See Also:
-
VILLAGER_PROFESSION
Villager profession.- See Also:
-
VILLAGER_TYPE
Villager type.- See Also:
-
MEMORY_MODULE_TYPE
Memory Keys.- See Also:
-
FLUID
Server fluids.- See Also:
-
FROG_VARIANT
Frog variants.- See Also:
-
WOLF_VARIANT
Wolf variants.- See Also:
-
MAP_DECORATION_TYPE
Map cursor types.- See Also:
-
GAME_EVENT
Game events.- See Also:
-
-
Method Details
-
get
Get the object by its key.- Parameters:
key
- non-null key- Returns:
- item or null if does not exist
-
getOrThrow
Get the object by its key. If there is no object with the given key, an exception will be thrown.- Parameters:
key
- to get the object from- Returns:
- object with the given key
- Throws:
IllegalArgumentException
- if there is no object with the given key
-
stream
Returns a new stream, which contains all registry items, which are registered to the registry.- Returns:
- a stream of all registry items
-
match
Attempts to match the registered object with the given key.This will attempt to find a reasonable match based on the provided input and may do so through unspecified means.
- Parameters:
input
- non-null input- Returns:
- registered object or null if does not exist
-