Class BukkitWorldRepository
java.lang.Object
com.winterhavenmc.library.messagebuilder.adapters.resources.configuration.BukkitWorldRepository
- All Implemented Interfaces:
ConfigProvider<EnabledWorldsSetting>,WorldRepository
-
Method Summary
Modifier and TypeMethodDescriptionaliasOrName(UUID worldUid) booleancheck if uuid is present in the registrystatic WorldRepositorycreate(org.bukkit.plugin.Plugin plugin, WorldNameResolver worldNameResolver, SpawnLocationResolver spawnLocationResolver) Static factory method creates instance of WorldRepositoryget collection of enabled world names from registryReturns a list of world uuids that are enabled by the plugin config.get()Returns the currentEnabledWorldsSetting.booleanCheck if a world is enabled by namebooleanCheck if a world is enabled by bukkit world UIDOptional<org.bukkit.Location> spawnLocation(UUID worldUid)
-
Method Details
-
create
public static WorldRepository create(org.bukkit.plugin.Plugin plugin, WorldNameResolver worldNameResolver, SpawnLocationResolver spawnLocationResolver) Static factory method creates instance of WorldRepository- Parameters:
plugin- an instance of the plugin- Returns:
- an WorldRepository
-
get
Description copied from interface:WorldRepositoryReturns the currentEnabledWorldsSetting.- Specified by:
getin interfaceConfigProvider<EnabledWorldsSetting>- Specified by:
getin interfaceWorldRepository- Returns:
- the current enabled worlds setting
-
enabledUids
Description copied from interface:WorldRepositoryReturns a list of world uuids that are enabled by the plugin config. Only world uuids that match a current server world are included in the list.- Specified by:
enabledUidsin interfaceWorldRepository- Returns:
- List of enabled world uuids
-
enabledNames
Description copied from interface:WorldRepositoryget collection of enabled world names from registry- Specified by:
enabledNamesin interfaceWorldRepository- Returns:
- a Collection of String containing enabled world names
-
aliasOrName
- Specified by:
aliasOrNamein interfaceWorldRepository
-
isEnabled
Check if a world is enabled by bukkit world UID- Specified by:
isEnabledin interfaceWorldRepository- Parameters:
worldUID- Unique Identifier for world- Returns:
trueif world is enabled,falseif disabled
-
isEnabled
Check if a world is enabled by name- Specified by:
isEnabledin interfaceWorldRepository- Parameters:
worldName- name of world as string to check- Returns:
trueif world is enabled,falseif disabled
-
contains
check if uuid is present in the registry- Specified by:
containsin interfaceWorldRepository- Parameters:
uuid- the uuid of a world- Returns:
booleantrue if the world uuid is present in the registry, or false if not
-
spawnLocation
- Specified by:
spawnLocationin interfaceWorldRepository
-