Class UpgradeRegistry
java.lang.Object
org.screamingsandals.bedwars.api.upgrades.UpgradeRegistry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Unregister all active upgrades of any type from gamestatic UpgradeStorage
getUpgrade
(String name) Get storage for upgradesstatic boolean
isUpgradeRegistered
(String name) Check if upgrade is registeredstatic UpgradeStorage
registerUpgrade
(String name, Class<? extends Upgrade> upgradeClass) Register new type of upgrade.static void
unregisterUpgrade
(String name) Unregister upgrade type
-
Constructor Details
-
UpgradeRegistry
public UpgradeRegistry()
-
-
Method Details
-
registerUpgrade
Register new type of upgrade. If upgrade type is registered, you can buy upgrade in shop.- Parameters:
name
- Name of upgradeupgradeClass
- Class type of upgrade- Returns:
- new instance of upgrade storage
-
unregisterUpgrade
Unregister upgrade type- Parameters:
name
- Name of upgrade
-
isUpgradeRegistered
Check if upgrade is registered- Parameters:
name
- Name of upgrade- Returns:
- if upgrade is registered
-
getUpgrade
Get storage for upgrades- Parameters:
name
- Name of upgrade- Returns:
- storage of specified upgrade type or null
-
clearAll
Unregister all active upgrades of any type from game- Parameters:
game
- that is ending
-