KeysManager provides methods to create and manage keys that represent entities, blocks, materials, and items in a consistent way across the plugin.
Entity Keys
getKey (EntityType)
Get the key of an entity type.The entity type to check.
The key representing the entity type.
getEntityTypeKey
Get the key of an entity type by name.The name of the entity type to create key for.
The key representing the entity type.
getKey (Entity)
Get the key of an entity.The entity to check.
The key representing the entity.
Block Keys
getKey (Block)
Get the key of a block.The block to check.
The key representing the block.
getKey (BlockState)
Get the key of a block-state.The block-state to check.
The key representing the block state.
Item Keys
getKey (ItemStack)
Get the key of an item-stack.The item-stack to check.
The key representing the item stack.
Material Keys
getKey (Material with data)
Get the key of a material and data.The material to check.
The data to check.
The key representing the material with data.
getKey (Material)
Get the key of a material.The material to create key for.
The key representing the material.
getMaterialAndDataKey
Get the key of a material and data, split by ’:’ (optionally).The combined material-data pair to create key for.
The key representing the material and data.
Spawner Keys
getSpawnerKey (EntityType)
Get the key of a spawner block with specific entity type.The entity type of the spawner to create key for.
The key representing the spawner.
getSpawnerKey (String)
Get the key of a spawner block with specific entity type by name.The name of the entity type of the spawner to create key for.
The key representing the spawner.
String Keys
getKey (String)
Get the key of a string.The string to check.
The key representing the string.
getKey (global and sub key)
Get the key of a global-key and a sub-key.The global key.
The sub key.
The key representing the combined keys.
Key Collections
createKeySet (empty)
Create a new empty KeySet instance.The supplier to create the underlying set.
A new empty KeySet instance.
createKeySet (from collection)
Create a new KeySet instance from the given collection.The supplier to create the underlying set.
The collection to create KeySet from.
A new KeySet instance containing the collection elements.
If the provided collection is also a KeySet, the exact same instance of that set is returned. Otherwise, the returned KeySet is a copy of that collection.
Key Maps
createKeyMap (empty)
Create a new empty KeyMap instance.The supplier to create the underlying map.
A new empty KeyMap instance.
createKeyMap (from map)
Create a new KeyMap instance from the given map.The supplier to create the underlying map.
The map to create KeySet from.
A new KeyMap instance containing the map elements.
If the provided map is also a KeyMap, the exact same instance of the map is returned. Otherwise, the returned KeyMap is a copy of that map.