Class GenTiersAPI

java.lang.Object
me.metallicgoat.tweaksaddon.api.GenTiersAPI

public class GenTiersAPI extends Object
Represents the API to interact with the Gen Tiers system of MBedwars Tweaks
  • Constructor Details

    • GenTiersAPI

      public GenTiersAPI()
  • Method Details

    • getDragons

      public static List<SuddenDeathDragon> getDragons(Arena arena, Team team)
      Get the dragons for a specific team in an arena.
      Parameters:
      arena - The arena which we are truing to get the dragons
      team - The team which the dragon belongs to
      Returns:
      A list of actively running SuddenDeathDragons
    • getDragons

      public static List<SuddenDeathDragon> getDragons(Arena arena)
      Get the dragons for arena.
      Parameters:
      arena - The arena which we are truing to get the dragons
      Returns:
      A list of actively running SuddenDeathDragons
    • getDragons

      public static List<SuddenDeathDragon> getDragons()
      Get all existing dragons.
      Returns:
      A list of actively running SuddenDeathDragons
    • getState

      @Nullable public static @Nullable GenTierState getState(Arena arena)
      Get the GenTierState of an arena Will return null if the gen tier system is not running in the specified arena
      Parameters:
      arena - the arena where we are grabbing the GenTierState from
      Returns:
      The GenTierState of the corresponding arena
    • getTiers

      public static Collection<GenTierLevel> getTiers()
      Get all configured Gen Tiers
      Returns:
      An unmodifiable collection of all configured Gen Tiers
    • getTier

      @Nullable public static @Nullable GenTierLevel getTier(int level)
      Get a specific Gen Tier by its level
      Parameters:
      level - The level of the Gen Tier you are trying to get
      Returns:
      The Gen Tier of the corresponding level
    • getFirstTier

      @Nullable public static @Nullable GenTierLevel getFirstTier()
      Get the first Gen Tier (level 1)
      Returns:
      The Gen Tier of level 1
    • registerHandler

      public static void registerHandler(GenTierHandler handler)
      Register a custom GenTierHandler! You will need to implement the GenTierHandler
      Parameters:
      handler - The GenTier you are registering
    • unregisterHandler

      public static void unregisterHandler(String id)
      Unregisters a Gen Tier Handler. Using this you could replace internal handlers
      Parameters:
      id - The id of the handler
    • getHandlerById

      @Nullable public static @Nullable GenTierHandler getHandlerById(String id)
      Gets a GenTierHandler by its id
      Parameters:
      id - The id of the handler
    • getHandlers

      public static Collection<GenTierHandler> getHandlers()
      Get all registered GenTierHandlers
      Returns:
      all registered GenTierHandlers
    • reloadConfig

      public static void reloadConfig()
      Reloads the gen-tiers config and applies any changes made to it

      Note: This will NOT update any arenas that are currently running the gen tier system, and as a result might cause weird states for active arenas. Runs IO on the same thread that it was called on.