From c6a8f7c0957f9f678cbf85fb12741677533c37cc Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 20 Jun 2023 21:03:47 -0700 Subject: [PATCH] Add API to enable gamemodes to register ownership over additional worlds --- .../bentobox/bentobox/managers/IslandWorldManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java index cbb8a31d6..3b2678e8b 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java @@ -143,6 +143,16 @@ public class IslandWorldManager { .anyMatch(gm -> gm.getWorldSettings().getFriendlyName().equalsIgnoreCase(name)); } + /** + * Associate a world with a game mode. This enables game modes to register more worlds than just the standard + * overworld, nether, and end worlds. + * @param world world + * @param gameMode game mode + * @since 1.24.0 + */ + public void addWorld(World world, GameModeAddon gameMode) { + gameModes.put(world, gameMode); + } /** * Adds a GameMode to island world manager