Class WandUpgrades

java.lang.Object
com.binaris.wizardry.setup.registries.WandUpgrades

public final class WandUpgrades extends Object
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 Type
    Method
    Description
    static String
    getIdentifier(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.
    static HashMap<net.minecraft.world.item.Item,String>
    Retrieves the map of all registered wand upgrades including their identifiers (String value used in SpellModifiers).
    static void
    Initializes and registers all predefined wand upgrades.
    static boolean
    isWandUpgrade(net.minecraft.world.item.Item upgrade)
    Checks if the given item is registered as a wand upgrade.
    static void
    register(net.minecraft.world.item.Item upgrade, String identifier)
    Registers a wand upgrade item with its corresponding identifier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the register(Item, String) method.
    • register

      public static void register(net.minecraft.world.item.Item upgrade, String identifier)
      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

      public static String getIdentifier(net.minecraft.world.item.Item upgrade)
      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

      public static HashMap<net.minecraft.world.item.Item,String> 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 use getSpecialUpgrades() instead.
      Returns:
      A HashMap containing wand upgrade items and their identifiers.
    • getSpecialUpgrades

      public static Set<net.minecraft.world.item.Item> getSpecialUpgrades()
      Retrieves an unmodifiable set of all the registered wand upgrade items. If you need the identifiers as well, use getWandUpgrades() 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.