Class VersionManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
Indicates whether the API version is present or supported.private final boolean
Indicates whether block data is supported.private final boolean
Indicates whether compass meta data is supported.private final boolean
Indicates whether the configuration contains specific settings or features.private final boolean
Indicates whether curse enchantments are supported.private final boolean
Indicates whether hex color codes are supported.private final boolean
Indicates whether particle effects are supported.private final boolean
Indicates whether persistent data is supported.private final boolean
Indicates whether scoreboard tags are supported.private final boolean
Indicates whether a second hand item is supported.private final boolean
Indicates whether hand swing actions are supported.private final boolean
Indicates whether world height data is supported.private boolean
Indicates whether the server or plugin is based on the Bukkit API.private boolean
private boolean
Indicates whether the server is older than 1.20.5/1.20.6.private boolean
Indicates whether the server or plugin is based on Mohist.private boolean
private final boolean
private final String
The version of the server or plugin. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.enchantments.Enchantment
getEnchantmentForVersion
(String enchantment) Retrieves the appropriate enchantment type for the given version.org.bukkit.Material
getMaterialForVersion
(String material) Retrieves the appropriate enchantment type for the given version.org.bukkit.Particle
getParticleForVersion
(String particle) Retrieves the appropriate particle type for the given version.org.bukkit.potion.PotionEffectType
getPotionEffectTypeFromVersion
(String potionEffect) 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
is_v1_10()
Checks if the server version is 1.10.boolean
is_v1_11()
Checks if the server version is 1.11.boolean
is_v1_12()
Checks if the server version is 1.12.boolean
is_v1_13()
Checks if the server version is 1.13.boolean
is_v1_14()
Checks if the server version is 1.14.boolean
is_v1_15()
Checks if the server version is 1.15.boolean
is_v1_16()
Checks if the server version is 1.16.boolean
is_v1_17()
Checks if the server version is 1.17.boolean
is_v1_18()
Checks if the server version is 1.18.boolean
is_v1_19()
Checks if the server version is 1.19.boolean
is_v1_20()
Checks if the server version is 1.20.boolean
Checks if the server version is 1.20.5/6.boolean
is_v1_21()
Checks if the server version is 1.21/1.21.1.boolean
is_v1_7()
Checks if the server version is 1.7.boolean
is_v1_8()
Checks if the server version is 1.8.boolean
is_v1_9()
Checks if the server version is 1.9.boolean
isBukkit()
Checks if the server is running on Bukkit.boolean
isFolia()
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
isMohist()
Checks if the server is running on Mohist.boolean
isPaper()
boolean
-
Field Details
-
version
The version of the server or plugin.This
String
holds the version information, which is used to check compatibility and feature availability. -
hasConfigContains
private final boolean hasConfigContainsIndicates whether the configuration contains specific settings or features.This
boolean
flag shows if certain configuration settings or features are present in the plugin's configuration. -
hasAPIVersion
private final boolean hasAPIVersionIndicates whether the API version is present or supported.This
boolean
flag indicates if the API version information is available and supported by the server or plugin. -
hasBlockData
private final boolean hasBlockDataIndicates whether block data is supported.This
boolean
flag indicates if the server or plugin supports block data manipulation or retrieval. -
hasPersistentData
private final boolean hasPersistentDataIndicates whether persistent data is supported.This
boolean
flag shows if the server or plugin supports the use of persistent data containers. -
hasScoreboardTags
private final boolean hasScoreboardTagsIndicates whether scoreboard tags are supported.This
boolean
flag indicates if the server or plugin supports scoreboard tags for entities. -
hasHexColors
private final boolean hasHexColorsIndicates whether hex color codes are supported.This
boolean
flag shows if the server or plugin supports hexadecimal color codes for text or other elements. -
hasCompassMeta
private final boolean hasCompassMetaIndicates whether compass meta data is supported.This
boolean
flag indicates if the server or plugin supports compass meta data functionality. -
hasSwingHand
private final boolean hasSwingHandIndicates whether hand swing actions are supported.This
boolean
flag shows if the server or plugin supports actions related to hand swings. -
hasWorldHeight
private final boolean hasWorldHeightIndicates whether world height data is supported.This
boolean
flag indicates if the server or plugin supports retrieving or managing world height information. -
hasSecondHand
private final boolean hasSecondHandIndicates whether a second hand item is supported.This
boolean
flag shows if the server or plugin supports having items in a second hand slot. -
hasEnchantmentCurse
private final boolean hasEnchantmentCurseIndicates whether curse enchantments are supported.This
boolean
flag indicates if the server or plugin supports curse enchantments on items. -
hasParticle
private final boolean hasParticleIndicates whether particle effects are supported.This
boolean
flag shows if the server or plugin supports particle effects for visual effects or gameplay. -
isBukkit
private boolean isBukkitIndicates whether the server or plugin is based on the Bukkit API.This
boolean
flag shows if the server or plugin is using the Bukkit API. -
isMohist
private boolean isMohistIndicates whether the server or plugin is based on Mohist.This
boolean
flag shows if the server or plugin is using Mohist, a server software that combines Bukkit and Forge. -
isPaper
private boolean isPaper -
isFolia
private boolean isFolia -
isPost1_20_5
private final boolean isPost1_20_5 -
isLegacyVersion
private boolean isLegacyVersionIndicates whether the server is older than 1.20.5/1.20.6.This
boolean
flag shows if the server or plugin is older than 1.20.5/1.20.6.
-
-
Constructor Details
-
VersionManager
public VersionManager()Initializes a new instance of the VersionManager class.
-
-
Method Details
-
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() -
getParticleForVersion
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
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
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
-