Package dev.jaxydog.astral.register
Enum Class Environment
- All Implemented Interfaces:
Serializable,Comparable<Environment>,Constable
Represents a possible mod registration environment and its associated interface.
This is used to share common functionality during the automatic registration process.
You almost certainly do not need to use this directly.
- Since:
- 2.0.0
- See Also:
-
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 TypeMethodDescriptionfinal Class<? extends Registered> Returns this environment's associatedRegisteredinterface.final booleanisIgnored(IgnoreRegistration annotation) Returns whether this environment should be skipped based off of the provided annotation.final voidregisterValue(Registered value) Registers the provided value within this environment.static EnvironmentReturns the enum constant of this class with the specified name.static Environment[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COMMON
Represents both the client and the server environments.Note that this is distinctly different from
CLIENTandSERVER.The associated interface of this environment is
Registered.Common.- Since:
- 2.0.0
-
CLIENT
Represents the game client environment.The associated interface of this environment is
Registered.Client.- Since:
- 2.0.0
-
SERVER
Represents the game server environment.The associated interface of this environment is
Registered.Server.- Since:
- 2.0.0
-
GENERATOR
Represents the data generation environment.The associated interface of this environment is
Registered.Generated.- Since:
- 2.0.0
-
-
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
-
getInterface
Returns this environment's associatedRegisteredinterface.- Returns:
- An extension of
Registered. - Since:
- 2.0.0
-
registerValue
Registers the provided value within this environment.This method blindly takes any instance of
Registeredand attempts to cast it into its associated type. Extra care should be taken to ensure that the value is of the proper interface.- Parameters:
value- The value to be registered.- Throws:
IllegalArgumentException- If the provided value is not a valid instance of the associated interface.- Since:
- 2.0.0
-
isIgnored
Returns whether this environment should be skipped based off of the provided annotation.- Parameters:
annotation- The provided filter annotation.- Returns:
- Whether this environment should be ignored.
- Since:
- 2.0.0
-