Class Upgrades
java.lang.Object
org.cyclops.evilcraft.core.blockentity.upgrade.Upgrades
Factory class for creating new upgrade types.
These instances act as enums.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Upgrades.Upgradestatic final Upgrades.Upgradestatic final Upgrades.Upgradestatic final Upgrades.Upgradestatic final Upgrades.Upgrade -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Upgrades.UpgradegetUpgrade(String upgradeId) Get or create the unique upgrade instancestatic Upgrades.UpgradegetUpgrade(String upgradeId, int tier) Get or create the unique upgrade instancestatic Collection<Upgrades.Upgrade>static Upgrades.UpgradeEventTypestatic <T extends IUpgradable<T,O>, O>
voidsendEvent(T upgradable, IUpgradeSensitiveEvent<O> event) Send an upgrade sensitive event over the event bus for all upgrades the upgradable has.static <T extends IUpgradable<T,O>, O>
voidsendEvent(T upgradable, IUpgradeSensitiveEvent<O> event, Collection<Upgrades.Upgrade> upgrades) Send an upgrade sensitive event over the event bus.static <T extends IUpgradable<T,O>, O>
voidsendEvent(T upgradable, IUpgradeSensitiveEvent<O> event, Upgrades.Upgrade upgrade) Send an upgrade sensitive event over the event bus.static <T extends IUpgradable<T,O>, O>
voidsendEvent(T upgradable, IUpgradeSensitiveEvent<O> event, Upgrades.Upgrade... upgrades) Send an upgrade sensitive event over the event bus.
-
Field Details
-
TIERS
public static final int TIERS- See Also:
-
UPGRADE_TIER1
-
UPGRADE_TIER2
-
UPGRADE_TIER3
-
UPGRADE_SPEED
-
UPGRADE_EFFICIENCY
-
-
Constructor Details
-
Upgrades
public Upgrades()
-
-
Method Details
-
getUpgrades
-
getUpgrade
Get or create the unique upgrade instance- Parameters:
upgradeId- The unique id of the upgrade.tier- the upgrade tier.- Returns:
- The upgrade instance.
-
getUpgrade
Get or create the unique upgrade instance- Parameters:
upgradeId- The unique id of the upgrade.- Returns:
- The upgrade instance.
-
newUpgradeEventType
- Returns:
- A new unique UpgradeEventType.
-
sendEvent
public static <T extends IUpgradable<T,O>, void sendEventO> (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>, void sendEventO> (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>, void sendEventO> (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>, void sendEventO> (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.
-