Enum Class RegistrationFailedException.Reason
java.lang.Object
java.lang.Enum<RegistrationFailedException.Reason>
net.neoforged.neoforge.network.registration.RegistrationFailedException.Reason
- All Implemented Interfaces:
Serializable
,Comparable<RegistrationFailedException.Reason>
,Constable
,RegistrationFailedException.ReasonFormatter
- Enclosing class:
RegistrationFailedException
public static enum RegistrationFailedException.Reason
extends Enum<RegistrationFailedException.Reason>
implements RegistrationFailedException.ReasonFormatter
Defines possible reasons for a payload registration to fail.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe payload id is already registered.The payload id is registered in the wrong namespace.The registrar is invalid.Some other unknown reason, an exception was thrown downstream. -
Field Summary
Modifier and TypeFieldDescriptionprivate final RegistrationFailedException.ReasonFormatter
The internal formatter used to format the reason. -
Constructor Summary
ModifierConstructorDescriptionprivate
-
Method Summary
Modifier and TypeMethodDescriptionformat
(ResourceLocation id, String namespace) Creates a nice error message for the given parameters.Returns the enum constant of this class with the specified name.static RegistrationFailedException.Reason[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DUPLICATE_ID
The payload id is already registered. -
INVALID_NAMESPACE
The payload id is registered in the wrong namespace. -
INVALID_REGISTRAR
The registrar is invalid. -
UNKNOWN
Some other unknown reason, an exception was thrown downstream.
-
-
Field Details
-
formatter
The internal formatter used to format the reason.
-
-
Constructor Details
-
Reason
-
-
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
-
format
Creates a nice error message for the given parameters.- Specified by:
format
in interfaceRegistrationFailedException.ReasonFormatter
- Parameters:
id
- The id of the payload that was being registered.namespace
- The namespace the payload was being registered in.- Returns:
- A nice error message for the given parameters.
-