Class VersionManager

java.lang.Object
com.ranull.graves.manager.VersionManager

public final class VersionManager extends Object
Manages version-specific functionality for the Graves plugin.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a new instance of the VersionManager class.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.enchantments.Enchantment
    Retrieves the appropriate enchantment type for the given version.
    org.bukkit.Material
    Retrieves the appropriate enchantment type for the given version.
    org.bukkit.Particle
    Retrieves the appropriate particle type for the given version.
    org.bukkit.potion.PotionEffectType
     
    Retrieves the server version.
    boolean
    Checks if the server version has the API version.
    boolean
    Checks if the server version has block data support.
    boolean
    Checks if the server version has compass meta support.
    boolean
    Checks if the server version has the config contains method.
    boolean
    Checks if the server version has enchantment curse support.
    boolean
    Checks if the server version has hex color support.
    boolean
    Checks if the server version has min height support.
    boolean
    Checks if the server version has particle support.
    boolean
    Checks if the server version has persistent data support.
    boolean
    Checks if the server version has scoreboard tags support.
    boolean
    Checks if the server version has second hand support.
    boolean
    Checks if the server version has swing hand support.
    boolean
    Checks if the server version is 1.10.
    boolean
    Checks if the server version is 1.11.
    boolean
    Checks if the server version is 1.12.
    boolean
    Checks if the server version is 1.13.
    boolean
    Checks if the server version is 1.14.
    boolean
    Checks if the server version is 1.15.
    boolean
    Checks if the server version is 1.16.
    boolean
    Checks if the server version is 1.17.
    boolean
    Checks if the server version is 1.18.
    boolean
    Checks if the server version is 1.19.
    boolean
    Checks if the server version is 1.20.
    boolean
    Checks if the server version is 1.20.5/6.
    boolean
    Checks if the server version is 1.21/1.21.1.
    boolean
     
    boolean
    Checks if the server version is 1.7.
    boolean
    Checks if the server version is 1.8.
    boolean
    Checks if the server version is 1.9.
    boolean
    Checks if the server is running on Bukkit.
    boolean
    Checks if the server is running on Folia.
    boolean
    Checks if the server is running on Bukkit versions older than 1.20.5/1.20.6.
    boolean
    Checks if the server is running on Mohist.
    boolean
     
    boolean
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VersionManager

      public VersionManager()
      Initializes a new instance of the VersionManager class.
  • Method Details

    • getVersion

      public String getVersion()
      Retrieves the server version.
      Returns:
      The server version string.
    • isLegacyVersion

      public boolean isLegacyVersion()
      Checks if the server is running on Bukkit versions older than 1.20.5/1.20.6.
      Returns:
      True if the server is running on versions of Bukkit if older than 1.20.5/1.20.6.
    • isBukkit

      public boolean isBukkit()
      Checks if the server is running on Bukkit.
      Returns:
      True if the server is running on Bukkit, otherwise false.
    • isPaper

      public boolean isPaper()
    • isMohist

      public boolean isMohist()
      Checks if the server is running on Mohist.
      Returns:
      True if the server is running on Mohist, otherwise false.
    • isFolia

      public boolean isFolia()
      Checks if the server is running on Folia.
      Returns:
      True if the server is running on Folia, otherwise false.
    • hasConfigContains

      public boolean hasConfigContains()
      Checks if the server version has the config contains method.
      Returns:
      True if the server version has the config contains method, otherwise false.
    • hasAPIVersion

      public boolean hasAPIVersion()
      Checks if the server version has the API version.
      Returns:
      True if the server version has the API version, otherwise false.
    • hasBlockData

      public boolean hasBlockData()
      Checks if the server version has block data support.
      Returns:
      True if the server version has block data support, otherwise false.
    • hasPersistentData

      public boolean hasPersistentData()
      Checks if the server version has persistent data support.
      Returns:
      True if the server version has persistent data support, otherwise false.
    • hasScoreboardTags

      public boolean hasScoreboardTags()
      Checks if the server version has scoreboard tags support.
      Returns:
      True if the server version has scoreboard tags support, otherwise false.
    • hasHexColors

      public boolean hasHexColors()
      Checks if the server version has hex color support.
      Returns:
      True if the server version has hex color support, otherwise false.
    • hasCompassMeta

      public boolean hasCompassMeta()
      Checks if the server version has compass meta support.
      Returns:
      True if the server version has compass meta support, otherwise false.
    • hasSwingHand

      public boolean hasSwingHand()
      Checks if the server version has swing hand support.
      Returns:
      True if the server version has swing hand support, otherwise false.
    • hasMinHeight

      public boolean hasMinHeight()
      Checks if the server version has min height support.
      Returns:
      True if the server version has min height support, otherwise false.
    • hasSecondHand

      public boolean hasSecondHand()
      Checks if the server version has second hand support.
      Returns:
      True if the server version has second hand support, otherwise false.
    • hasEnchantmentCurse

      public boolean hasEnchantmentCurse()
      Checks if the server version has enchantment curse support.
      Returns:
      True if the server version has enchantment curse support, otherwise false.
    • hasParticle

      public boolean hasParticle()
      Checks if the server version has particle support.
      Returns:
      True if the server version has particle support, otherwise false.
    • is_v1_7

      public boolean is_v1_7()
      Checks if the server version is 1.7.
      Returns:
      True if the server version is 1.7, otherwise false.
    • is_v1_8

      public boolean is_v1_8()
      Checks if the server version is 1.8.
      Returns:
      True if the server version is 1.8, otherwise false.
    • is_v1_9

      public boolean is_v1_9()
      Checks if the server version is 1.9.
      Returns:
      True if the server version is 1.9, otherwise false.
    • is_v1_10

      public boolean is_v1_10()
      Checks if the server version is 1.10.
      Returns:
      True if the server version is 1.10, otherwise false.
    • is_v1_11

      public boolean is_v1_11()
      Checks if the server version is 1.11.
      Returns:
      True if the server version is 1.11, otherwise false.
    • is_v1_12

      public boolean is_v1_12()
      Checks if the server version is 1.12.
      Returns:
      True if the server version is 1.12, otherwise false.
    • is_v1_13

      public boolean is_v1_13()
      Checks if the server version is 1.13.
      Returns:
      True if the server version is 1.13, otherwise false.
    • is_v1_14

      public boolean is_v1_14()
      Checks if the server version is 1.14.
      Returns:
      True if the server version is 1.14, otherwise false.
    • is_v1_15

      public boolean is_v1_15()
      Checks if the server version is 1.15.
      Returns:
      True if the server version is 1.15, otherwise false.
    • is_v1_16

      public boolean is_v1_16()
      Checks if the server version is 1.16.
      Returns:
      True if the server version is 1.16, otherwise false.
    • is_v1_17

      public boolean is_v1_17()
      Checks if the server version is 1.17.
      Returns:
      True if the server version is 1.17, otherwise false.
    • is_v1_18

      public boolean is_v1_18()
      Checks if the server version is 1.18.
      Returns:
      True if the server version is 1.18, otherwise false.
    • is_v1_19

      public boolean is_v1_19()
      Checks if the server version is 1.19.
      Returns:
      True if the server version is 1.19, otherwise false.
    • is_v1_20

      public boolean is_v1_20()
      Checks if the server version is 1.20.
      Returns:
      True if the server version is 1.20, otherwise false.
    • is_v1_20_5

      public boolean is_v1_20_5()
      Checks if the server version is 1.20.5/6.
      Returns:
      True if the server version is 1.20.5/6, otherwise false.
    • is_v1_21

      public boolean is_v1_21()
      Checks if the server version is 1.21/1.21.1.
      Returns:
      True if the server version is 1.21/1.21.1, otherwise false.
    • isPost1_20_5

      public boolean isPost1_20_5()
    • is_v1_21_R5

      public boolean is_v1_21_R5()
    • isPost1_21_9

      public boolean isPost1_21_9()
    • getParticleForVersion

      public org.bukkit.Particle getParticleForVersion(String particle)
      Retrieves the appropriate particle type for the given version.
      Parameters:
      particle - The particle name.
      Returns:
      The Particle enum corresponding to the given particle name.
    • getEnchantmentForVersion

      public org.bukkit.enchantments.Enchantment getEnchantmentForVersion(String enchantment)
      Retrieves the appropriate enchantment type for the given version.
      Parameters:
      enchantment - The enchantment name.
      Returns:
      The Enchantment enum corresponding to the given enchantment name.
    • getMaterialForVersion

      public org.bukkit.Material getMaterialForVersion(String material)
      Retrieves the appropriate enchantment type for the given version.
      Parameters:
      material - The enchantment name.
      Returns:
      The Material enum corresponding to the given material name.
    • getPotionEffectTypeFromVersion

      public org.bukkit.potion.PotionEffectType getPotionEffectTypeFromVersion(String potionEffect)