Class UpgradeStorage

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

public final class UpgradeStorage extends Object
  • Method Details

    • getUpgradeName

      public String getUpgradeName()
      Returns:
      upgrade name
    • getUpgradeClass

      public Class<? extends Upgrade> getUpgradeClass()
      Returns:
      upgrade class type
    • addUpgrade

      public void addUpgrade(Game game, Upgrade upgrade)
      Register active upgrade in game
      Parameters:
      game - Game
      upgrade - Upgrade
    • removeUpgrade

      public void removeUpgrade(Game game, Upgrade upgrade)
      Unregister active upgrade
      Parameters:
      game - Game
      upgrade - Upgrade
    • isUpgradeRegistered

      public boolean isUpgradeRegistered(Game game, Upgrade upgrade)
      Parameters:
      game - Game
      upgrade - Upgrade
      Returns:
      true if upgrade is registered
    • resetUpgradesForGame

      public void resetUpgradesForGame(Game game)
      This is automatically used while game is ending
      Parameters:
      game - Game
    • getAllUpgradesOfGame

      public List<Upgrade> getAllUpgradesOfGame(Game game)
      Get all upgrades of this type that is registered in game as active
      Parameters:
      game - Game
      Returns:
      ĺist of registered upgrades of game
    • findUpgradeByName

      @Deprecated public List<Upgrade> findUpgradeByName(Game game, String instanceName)
      Deprecated.
      Find active upgrades with this instanceName
      Parameters:
      game - Game
      instanceName - name of spawner
      Returns:
      list of upgrades with same name
    • findItemSpawnerUpgrades

      public List<Upgrade> findItemSpawnerUpgrades(Game game, String spawnerInstanceName)
    • findItemSpawnerUpgrades

      public List<Upgrade> findItemSpawnerUpgrades(Game game, Team team)
    • findItemSpawnerUpgrades

      public List<Upgrade> findItemSpawnerUpgrades(Game game, Team team, ItemSpawnerType itemSpawnerType)