Class ResourcePackStatusAdapter
java.lang.Object
me.remigio07.chatplugin.api.server.util.adapter.user.ResourcePackStatusAdapter
Environment indipendent (Bukkit and Sponge) resource pack status adapter.
This class is a pseudo-Enum. It contains the following methods:
name(), ordinal(), valueOf(String) and values().
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourcePackStatusAdapterThe client accepted the pack and is beginning a download of it.static final ResourcePackStatusAdapterThe client declined to download the resource pack.static final ResourcePackStatusAdapterThe client accepted the pack, but download failed.static final ResourcePackStatusAdapterThe pack URI was successfully loaded. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.event.player.PlayerResourcePackStatusEvent.StatusGets the resource pack status adapted for Bukkit environments.name()Equivalent ofEnum.name().intordinal()Equivalent ofEnum.ordinal().org.spongepowered.api.event.entity.living.humanoid.player.ResourcePackStatusEvent.ResourcePackStatusGets the resource pack status adapted for Sponge environments.static ResourcePackStatusAdapterEquivalent ofEnum#valueOf(String), with the only difference that instead of throwingIllegalArgumentExceptionnullis returned if the constant's name is invalid.static ResourcePackStatusAdapter[]values()Equivalent ofEnum#values().
-
Field Details
-
ACCEPTED
The client accepted the pack and is beginning a download of it. -
DECLINED
The client declined to download the resource pack. -
FAILED
The client accepted the pack, but download failed. -
SUCCESSFULLY_DOWNLOADED
The pack URI was successfully loaded. This does not necessarily mean that the pack was loaded, as the Vanilla client sends this even when encountering a 404 error or similar.
-
-
Method Details
-
bukkitValue
public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status bukkitValue()Gets the resource pack status adapted for Bukkit environments.- Returns:
- Bukkit-adapted resource pack status
- Throws:
UnsupportedOperationException- If!Environment.isBukkit()
-
spongeValue
public org.spongepowered.api.event.entity.living.humanoid.player.ResourcePackStatusEvent.ResourcePackStatus spongeValue()Gets the resource pack status adapted for Sponge environments.- Returns:
- Sponge-adapted resource pack status
- Throws:
UnsupportedOperationException- If!Environment.isSponge()
-
name
Equivalent ofEnum.name().- Returns:
- Constant's name
-
ordinal
public int ordinal()Equivalent ofEnum.ordinal().- Returns:
- Constant's ordinal
-
valueOf
Equivalent ofEnum#valueOf(String), with the only difference that instead of throwingIllegalArgumentExceptionnullis returned if the constant's name is invalid.This method recognizes both Bukkit's and Sponge's IDs.
- Parameters:
name- Constant's name- Returns:
- Enum constant
-
values
Equivalent ofEnum#values().- Returns:
- Enum constants
-