Class WandUpgrades
java.lang.Object
com.binaris.wizardry.setup.registries.WandUpgrades
This class manages the registration and retrieval of wand upgrade items along with their unique identifiers. Wand upgrades
are just a different type of special item that can be used inside the
SpellModifiers to modify spell cast
properties. Essentially this is just a util class to save items and then retrieve their string identifiers to be used
inside the SpellModifiers.
It provides methods to register new wand upgrades, retrieve their identifiers, and access the collection of registered wand upgrades.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetIdentifier(net.minecraft.world.item.Item upgrade) Retrieves the identifier associated with the given wand upgrade item.static Set<net.minecraft.world.item.Item>Retrieves an unmodifiable set of all the registered wand upgrade items.Retrieves the map of all registered wand upgrades including their identifiers (String value used in SpellModifiers).static voidInitializes and registers all predefined wand upgrades.static booleanisWandUpgrade(net.minecraft.world.item.Item upgrade) Checks if the given item is registered as a wand upgrade.static voidRegisters a wand upgrade item with its corresponding identifier.
-
Method Details
-
initUpgrades
public static void initUpgrades()Initializes and registers all predefined wand upgrades. Avoid calling this method!! It is called automatically during mod setup, and it shouldn't be needed by any addon/modder. In case you need to register your own wand upgrades use theregister(Item, String)method. -
register
Registers a wand upgrade item with its corresponding identifier.- Parameters:
upgrade- The wand upgrade item to register.identifier- The unique identifier string for the wand upgrade.- Throws:
IllegalArgumentException- if the identifier is already registered (duplicate).
-
getIdentifier
Retrieves the identifier associated with the given wand upgrade item.- Parameters:
upgrade- The wand upgrade item.- Returns:
- The identifier string for the wand upgrade.
- Throws:
IllegalArgumentException- if the wand upgrade is not registered.
-
getWandUpgrades
Retrieves the map of all registered wand upgrades including their identifiers (String value used in SpellModifiers). If you need just the set of items usegetSpecialUpgrades()instead.- Returns:
- A HashMap containing wand upgrade items and their identifiers.
-
getSpecialUpgrades
Retrieves an unmodifiable set of all the registered wand upgrade items. If you need the identifiers as well, usegetWandUpgrades()instead.- Returns:
- An unmodifiable set of wand upgrade items.
-
isWandUpgrade
public static boolean isWandUpgrade(net.minecraft.world.item.Item upgrade) Checks if the given item is registered as a wand upgrade.- Parameters:
upgrade- The item to check.- Returns:
- True if the item is a registered wand upgrade, false otherwise.
-