Enum Class CookieEventType

java.lang.Object
java.lang.Enum<CookieEventType>
org.strassburger.cookieclickerz.util.cookieevents.CookieEventType
All Implemented Interfaces:
Serializable, Comparable<CookieEventType>, java.lang.constant.Constable

public enum CookieEventType extends Enum<CookieEventType>
  • Enum Constant Details

  • Method Details

    • values

      public static CookieEventType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CookieEventType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public String getId()
      Returns:
      the id of the event
    • isPositive

      public boolean isPositive()
      Returns:
      true if the event is positive, false otherwise
    • getAppearanceRate

      public double getAppearanceRate()
      Returns:
      appearance rate of the event
    • getDuration

      public long getDuration()
      Returns:
      duration of the event in ticks (0 if the event is instant)
    • isInstant

      public boolean isInstant()
      Returns:
      true if the event is instant, false otherwise
    • run

      public abstract void run(CookieClickerZ plugin, UUID uuid)
    • getRandom

      @Nullable public static @Nullable CookieEventType getRandom()
      Get a random CookieEventType based on appearance rates or null if no event should happen.
      Returns:
      a random CookieEventType or null