Class LinksManager
java.lang.Object
org.mvplugins.multiverse.netherportals.links.LinksManager
Manages the links.yml file.
- Since:
- 5.1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddWorldLink(@NotNull String fromWorld, @NotNull String toWorld, @NotNull WorldLinkType worldLinkType) Adds or replaces a world link in memory.booleanaddWorldLink(@NotNull org.mvplugins.multiverse.core.world.MultiverseWorld fromWorld, @NotNull org.mvplugins.multiverse.core.world.MultiverseWorld toWorld, @NotNull WorldLinkType worldLinkType) Adds or replaces a world link in memory.getLinksMapForType(@NotNull WorldLinkType worldLinkType) Gets all source-to-destination mappings for a link type.@NotNull org.mvplugins.multiverse.external.vavr.control.Option<WorldLink> getWorldLink(@NotNull String worldName) Gets the complete link configuration for a source world.@NotNull org.mvplugins.multiverse.external.vavr.control.Option<String> getWorldLink(@NotNull String worldName, @NotNull WorldLinkType worldLinkType) Gets a destination for a source world and link type.@NotNull @UnmodifiableView Collection<WorldLink> Gets all configured world links.booleanisLoaded()Checks whether links.yml has been loaded.org.mvplugins.multiverse.external.vavr.control.Try<Void> load()Loads links.yml and imports any legacy links from config.yml.booleanremoveWorldLink(@NotNull String fromWorld, @NotNull WorldLinkType worldLinkType) Removes a world link from memory.booleanremoveWorldLink(@NotNull org.mvplugins.multiverse.core.world.MultiverseWorld fromWorld, @NotNull WorldLinkType worldLinkType) Removes a world link from memory.org.mvplugins.multiverse.external.vavr.control.Try<Void> save()Saves all world links to links.yml.
-
Field Details
-
LINKS_FILENAME
- See Also:
-
-
Method Details
-
load
Loads links.yml and imports any legacy links from config.yml.- Returns:
- The result of the load operation.
- Since:
- 5.1
-
isLoaded
@AvailableSince("5.1") public boolean isLoaded()Checks whether links.yml has been loaded.- Returns:
- Whether the manager is loaded.
- Since:
- 5.1
-
save
Saves all world links to links.yml.- Returns:
- The result of the save operation.
- Since:
- 5.1
-
getWorldLink
@AvailableSince("5.1") @NotNull public @NotNull org.mvplugins.multiverse.external.vavr.control.Option<WorldLink> getWorldLink(@NotNull @NotNull String worldName) Gets the complete link configuration for a source world.- Parameters:
worldName- The source world name.- Returns:
- The world link, or an empty option when none exists.
- Since:
- 5.1
-
getWorldLink
@AvailableSince("5.1") @NotNull public @NotNull org.mvplugins.multiverse.external.vavr.control.Option<String> getWorldLink(@NotNull @NotNull String worldName, @NotNull @NotNull WorldLinkType worldLinkType) Gets a destination for a source world and link type.- Parameters:
worldName- The source world name.worldLinkType- The link type.- Returns:
- The destination world, or an empty option when unset.
- Since:
- 5.1
-
getWorldLinks
@AvailableSince("5.1") @NotNull public @NotNull @UnmodifiableView Collection<WorldLink> getWorldLinks()Gets all configured world links.- Returns:
- An unmodifiable collection of world links.
- Since:
- 5.1
-
getLinksMapForType
@AvailableSince("5.1") @NotNull public @NotNull Map<String,String> getLinksMapForType(@NotNull @NotNull WorldLinkType worldLinkType) Gets all source-to-destination mappings for a link type.- Parameters:
worldLinkType- The link type.- Returns:
- The configured source-to-destination mappings.
- Since:
- 5.1
-
addWorldLink
@AvailableSince("5.1") public boolean addWorldLink(@NotNull @NotNull String fromWorld, @NotNull @NotNull String toWorld, @NotNull @NotNull WorldLinkType worldLinkType) Adds or replaces a world link in memory.- Parameters:
fromWorld- The source world name.toWorld- The destination world name.worldLinkType- The link type.- Returns:
- Whether the link was updated.
- Since:
- 5.1
-
addWorldLink
@AvailableSince("5.1") public boolean addWorldLink(@NotNull @NotNull org.mvplugins.multiverse.core.world.MultiverseWorld fromWorld, @NotNull @NotNull org.mvplugins.multiverse.core.world.MultiverseWorld toWorld, @NotNull @NotNull WorldLinkType worldLinkType) Adds or replaces a world link in memory.- Parameters:
fromWorld- The source world.toWorld- The destination world.worldLinkType- The link type.- Returns:
- Whether the link was updated.
- Since:
- 5.1
-
removeWorldLink
@AvailableSince("5.1") public boolean removeWorldLink(@NotNull @NotNull String fromWorld, @NotNull @NotNull WorldLinkType worldLinkType) Removes a world link from memory.- Parameters:
fromWorld- The source world name.worldLinkType- The link type.- Returns:
- Whether the link existed and was removed.
- Since:
- 5.1
-
removeWorldLink
@AvailableSince("5.1") public boolean removeWorldLink(@NotNull @NotNull org.mvplugins.multiverse.core.world.MultiverseWorld fromWorld, @NotNull @NotNull WorldLinkType worldLinkType) Removes a world link from memory.- Parameters:
fromWorld- The source world.worldLinkType- The link type.- Returns:
- Whether the link existed and was removed.
- Since:
- 5.1
-