Class ResourcePackStatusAdapter

java.lang.Object
me.remigio07.chatplugin.api.server.util.adapter.user.ResourcePackStatusAdapter

public class ResourcePackStatusAdapter extends Object
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 Details

    • ACCEPTED

      public static final ResourcePackStatusAdapter ACCEPTED
      The client accepted the pack and is beginning a download of it.
    • DECLINED

      public static final ResourcePackStatusAdapter DECLINED
      The client declined to download the resource pack.
    • FAILED

      public static final ResourcePackStatusAdapter FAILED
      The client accepted the pack, but download failed.
    • SUCCESSFULLY_DOWNLOADED

      public static final ResourcePackStatusAdapter 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

      public String name()
      Equivalent of Enum.name().
      Returns:
      Constant's name
    • ordinal

      public int ordinal()
      Equivalent of Enum.ordinal().
      Returns:
      Constant's ordinal
    • valueOf

      public static ResourcePackStatusAdapter valueOf(String name)
      Equivalent of Enum#valueOf(String), with the only difference that instead of throwing IllegalArgumentException 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

      public static ResourcePackStatusAdapter[] values()
      Equivalent of Enum#values().
      Returns:
      Enum constants