From 3ea441149060672d417378abf46fd6a25e02ef15 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 29 Jan 2020 00:36:58 +0100 Subject: [PATCH] Additional getters --- .../erethon/dungeonsxl/api/DungeonsAPI.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/api/src/main/java/de/erethon/dungeonsxl/api/DungeonsAPI.java b/api/src/main/java/de/erethon/dungeonsxl/api/DungeonsAPI.java index e80de43b..9a459e98 100644 --- a/api/src/main/java/de/erethon/dungeonsxl/api/DungeonsAPI.java +++ b/api/src/main/java/de/erethon/dungeonsxl/api/DungeonsAPI.java @@ -17,22 +17,27 @@ package de.erethon.dungeonsxl.api; import de.erethon.caliburn.mob.ExMob; import de.erethon.commons.misc.Registry; import de.erethon.dungeonsxl.api.dungeon.Dungeon; +import de.erethon.dungeonsxl.api.dungeon.Game; import de.erethon.dungeonsxl.api.dungeon.GameRule; import de.erethon.dungeonsxl.api.mob.DungeonMob; import de.erethon.dungeonsxl.api.mob.ExternalMobProvider; import de.erethon.dungeonsxl.api.player.PlayerClass; import de.erethon.dungeonsxl.api.player.PlayerGroup; import de.erethon.dungeonsxl.api.sign.DungeonSign; +import de.erethon.dungeonsxl.api.world.EditWorld; import de.erethon.dungeonsxl.api.world.GameWorld; import de.erethon.dungeonsxl.api.world.InstanceWorld; import de.erethon.dungeonsxl.api.world.ResourceWorld; import java.io.File; import java.util.Collection; +import org.bukkit.World; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; /** + * The API main interface. + * * @author Daniel Saukel */ public interface DungeonsAPI extends Plugin { @@ -216,4 +221,52 @@ public interface DungeonsAPI extends Plugin { */ DungeonMob getDungeonMob(LivingEntity entity); + /** + * Returns the game the given group plays. + * + * @param group the group + * @return the game the given group plays + */ + Game getGame(PlayerGroup group); + + /** + * Returns the game the given player plays. + * + * @param player the player + * @return the game the given player plays + */ + Game getGame(Player player); + + /** + * Returns the game played in the given instance world. + * + * @param world the instance world + * @return the game played in the given instance world + */ + Game getGame(World world); + + /** + * Returns the GameWorld that wraps the given instance world. + * + * @param world the instance world + * @return the GameWorld that wraps the given instance world + */ + GameWorld getGameWorld(World world); + + /** + * Returns the EditWorld that wraps the given instance world. + * + * @param world the instance world + * @return the EditWorld that wraps the given instance worl + */ + EditWorld getEditWorld(World world); + + /** + * Returns if the given world is an instance. + * + * @param world the world + * @return if the given world is an instance + */ + boolean isInstance(World world); + }