Class UpgradeRegistry

java.lang.Object
org.screamingsandals.bedwars.api.upgrades.UpgradeRegistry

public final class UpgradeRegistry extends Object
  • Constructor Details

    • UpgradeRegistry

      public UpgradeRegistry()
  • Method Details

    • registerUpgrade

      public static UpgradeStorage registerUpgrade(String name, Class<? extends Upgrade> upgradeClass)
      Register new type of upgrade. If upgrade type is registered, you can buy upgrade in shop.
      Parameters:
      name - Name of upgrade
      upgradeClass - Class type of upgrade
      Returns:
      new instance of upgrade storage
    • unregisterUpgrade

      public static void unregisterUpgrade(String name)
      Unregister upgrade type
      Parameters:
      name - Name of upgrade
    • isUpgradeRegistered

      public static boolean isUpgradeRegistered(String name)
      Check if upgrade is registered
      Parameters:
      name - Name of upgrade
      Returns:
      if upgrade is registered
    • getUpgrade

      public static UpgradeStorage getUpgrade(String name)
      Get storage for upgrades
      Parameters:
      name - Name of upgrade
      Returns:
      storage of specified upgrade type or null
    • clearAll

      public static void clearAll(Game game)
      Unregister all active upgrades of any type from game
      Parameters:
      game - that is ending