java.lang.Object
org.cyclops.evilcraft.core.blockentity.upgrade.Upgrades

public class Upgrades extends Object
Factory class for creating new upgrade types. These instances act as enums.
  • Field Details

  • Constructor Details

    • Upgrades

      public Upgrades()
  • Method Details

    • getUpgrades

      public static Collection<Upgrades.Upgrade> getUpgrades()
    • getUpgrade

      public static Upgrades.Upgrade getUpgrade(String upgradeId, int tier)
      Get or create the unique upgrade instance
      Parameters:
      upgradeId - The unique id of the upgrade.
      tier - the upgrade tier.
      Returns:
      The upgrade instance.
    • getUpgrade

      public static Upgrades.Upgrade getUpgrade(String upgradeId)
      Get or create the unique upgrade instance
      Parameters:
      upgradeId - The unique id of the upgrade.
      Returns:
      The upgrade instance.
    • newUpgradeEventType

      public static Upgrades.UpgradeEventType newUpgradeEventType()
      Returns:
      A new unique UpgradeEventType.
    • sendEvent

      public static <T extends IUpgradable<T, O>, O> void sendEvent(T upgradable, IUpgradeSensitiveEvent<O> event)
      Send an upgrade sensitive event over the event bus for all upgrades the upgradable has.
      Type Parameters:
      T - The type of upgradable.
      O - The type of event variable type.
      Parameters:
      upgradable - The upgradable instance.
      event - The event.
    • sendEvent

      public static <T extends IUpgradable<T, O>, O> void sendEvent(T upgradable, IUpgradeSensitiveEvent<O> event, Upgrades.Upgrade upgrade)
      Send an upgrade sensitive event over the event bus.
      Type Parameters:
      T - The type of upgradable.
      O - The type of event variable type.
      Parameters:
      upgradable - The upgradable instance.
      event - The event.
      upgrade - The types of upgrade this event should be sent to.
    • sendEvent

      public static <T extends IUpgradable<T, O>, O> void sendEvent(T upgradable, IUpgradeSensitiveEvent<O> event, Upgrades.Upgrade... upgrades)
      Send an upgrade sensitive event over the event bus.
      Type Parameters:
      T - The type of upgradable.
      O - The type of event variable type.
      Parameters:
      upgradable - The upgradable instance.
      event - The event.
      upgrades - The types of upgrades this event should be sent to.
    • sendEvent

      public static <T extends IUpgradable<T, O>, O> void sendEvent(T upgradable, IUpgradeSensitiveEvent<O> event, Collection<Upgrades.Upgrade> upgrades)
      Send an upgrade sensitive event over the event bus.
      Type Parameters:
      T - The type of upgradable.
      O - The type of event variable type.
      Parameters:
      upgradable - The upgradable instance.
      event - The event.
      upgrades - The types of upgrades this event should be sent to.