Enum ResourcePackStatusEvent.ResourcePackStatus
- java.lang.Object
-
- java.lang.Enum<ResourcePackStatusEvent.ResourcePackStatus>
-
- org.spongepowered.api.event.entity.living.player.ResourcePackStatusEvent.ResourcePackStatus
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ResourcePackStatusEvent.ResourcePackStatus>
- Enclosing interface:
- ResourcePackStatusEvent
public static enum ResourcePackStatusEvent.ResourcePackStatus extends java.lang.Enum<ResourcePackStatusEvent.ResourcePackStatus>
The different possible responses the client can have.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPTED
The client is attempting to download the pack.DECLINED
The client declined to download the pack.FAILED
The client failed to download the resource pack.SUCCESSFULLY_LOADED
The pack URI was successfully loaded.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourcePackStatusEvent.ResourcePackStatus
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ResourcePackStatusEvent.ResourcePackStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.java.util.Optional<java.lang.Boolean>
wasSuccessful()
Gets if this status indicates that the pack was successfully set.
-
-
-
Enum Constant Detail
-
ACCEPTED
public static final ResourcePackStatusEvent.ResourcePackStatus ACCEPTED
The client is attempting to download the pack.
-
DECLINED
public static final ResourcePackStatusEvent.ResourcePackStatus DECLINED
The client declined to download the pack.
-
FAILED
public static final ResourcePackStatusEvent.ResourcePackStatus FAILED
The client failed to download the resource pack.In some client versions, such as 1.8.0, this may only be sent when the resource pack URL does not end in
.zip
. Otherwise,SUCCESSFULLY_LOADED
will be sent.
-
SUCCESSFULLY_LOADED
public static final ResourcePackStatusEvent.ResourcePackStatus SUCCESSFULLY_LOADED
The pack URI was successfully loaded. This does not mean that pack was loaded, as the vanilla client sends this even when encountering a 404 or similar.
-
-
Method Detail
-
values
public static ResourcePackStatusEvent.ResourcePackStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ResourcePackStatusEvent.ResourcePackStatus c : ResourcePackStatusEvent.ResourcePackStatus.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResourcePackStatusEvent.ResourcePackStatus valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
wasSuccessful
public java.util.Optional<java.lang.Boolean> wasSuccessful()
Gets if this status indicates that the pack was successfully set.- Returns:
- true if it was successful, false if it was not, and Optional.empty() if it cannot be determined at this time.
-
-