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
Modifier and TypeFieldDescriptionstatic final ResourcePackStatusAdapter
The client accepted the pack and is beginning a download of it.static final ResourcePackStatusAdapter
The client declined to download the resource pack.static final ResourcePackStatusAdapter
The client accepted the pack, but download failed.static final ResourcePackStatusAdapter
The pack URI was successfully loaded. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.event.player.PlayerResourcePackStatusEvent.Status
Gets the resource pack status adapted for Bukkit environments.name()
Equivalent ofEnum.name()
.int
ordinal()
Equivalent ofEnum.ordinal()
.org.spongepowered.api.event.entity.living.humanoid.player.ResourcePackStatusEvent.ResourcePackStatus
Gets the resource pack status adapted for Sponge environments.static ResourcePackStatusAdapter
Equivalent ofEnum#valueOf(String)
, with the only difference that instead of throwingIllegalArgumentException
null
is 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 throwingIllegalArgumentException
null
is 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
-