Package com.jozufozu.flywheel.util
Enum Class Mods
- All Implemented Interfaces:
Serializable,Comparable<Mods>,Constable
For compatibility with and without another mod present, we have to define load conditions of the specific code
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteIfInstalled(Supplier<Runnable> toExecute) Simple hook to execute code if a mod is installedbooleanisLoaded()<T> Optional<T>runIfInstalled(Supplier<Supplier<T>> toRun) Simple hook to run code if a mod is installedstatic ModsReturns the enum constant of this class with the specified name.static Mods[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STARLIGHT
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
isLoaded
public boolean isLoaded()- Returns:
- a boolean of whether the mod is loaded or not based on mod id
-
runIfInstalled
Simple hook to run code if a mod is installed- Parameters:
toRun- will be run only if the mod is loaded- Returns:
- Optional.empty() if the mod is not loaded, otherwise an Optional of the return value of the given supplier
-
executeIfInstalled
Simple hook to execute code if a mod is installed- Parameters:
toExecute- will be executed only if the mod is loaded
-