Class VersionManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanIndicates whether the API version is present or supported.private final booleanIndicates whether block data is supported.private final booleanIndicates whether compass meta data is supported.private final booleanIndicates whether the configuration contains specific settings or features.private final booleanIndicates whether curse enchantments are supported.private final booleanIndicates whether hex color codes are supported.private final booleanIndicates whether particle effects are supported.private final booleanIndicates whether persistent data is supported.private final booleanIndicates whether scoreboard tags are supported.private final booleanIndicates whether a second hand item is supported.private final booleanIndicates whether hand swing actions are supported.private final booleanIndicates whether world height data is supported.private booleanIndicates whether the server or plugin is based on the Bukkit API.private booleanprivate booleanIndicates whether the server is older than 1.20.5/1.20.6.private booleanIndicates whether the server or plugin is based on Mohist.private booleanprivate final booleanprivate final StringThe version of the server or plugin. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.enchantments.EnchantmentgetEnchantmentForVersion(String enchantment) Retrieves the appropriate enchantment type for the given version.org.bukkit.MaterialgetMaterialForVersion(String material) Retrieves the appropriate enchantment type for the given version.org.bukkit.ParticlegetParticleForVersion(String particle) Retrieves the appropriate particle type for the given version.org.bukkit.potion.PotionEffectTypegetPotionEffectTypeFromVersion(String potionEffect) Retrieves the server version.booleanChecks if the server version has the API version.booleanChecks if the server version has block data support.booleanChecks if the server version has compass meta support.booleanChecks if the server version has the config contains method.booleanChecks if the server version has enchantment curse support.booleanChecks if the server version has hex color support.booleanChecks if the server version has min height support.booleanChecks if the server version has particle support.booleanChecks if the server version has persistent data support.booleanChecks if the server version has scoreboard tags support.booleanChecks if the server version has second hand support.booleanChecks if the server version has swing hand support.booleanis_v1_10()Checks if the server version is 1.10.booleanis_v1_11()Checks if the server version is 1.11.booleanis_v1_12()Checks if the server version is 1.12.booleanis_v1_13()Checks if the server version is 1.13.booleanis_v1_14()Checks if the server version is 1.14.booleanis_v1_15()Checks if the server version is 1.15.booleanis_v1_16()Checks if the server version is 1.16.booleanis_v1_17()Checks if the server version is 1.17.booleanis_v1_18()Checks if the server version is 1.18.booleanis_v1_19()Checks if the server version is 1.19.booleanis_v1_20()Checks if the server version is 1.20.booleanChecks if the server version is 1.20.5/6.booleanis_v1_21()Checks if the server version is 1.21/1.21.1.booleanis_v1_7()Checks if the server version is 1.7.booleanis_v1_8()Checks if the server version is 1.8.booleanis_v1_9()Checks if the server version is 1.9.booleanisBukkit()Checks if the server is running on Bukkit.booleanisFolia()Checks if the server is running on Folia.booleanChecks if the server is running on Bukkit versions older than 1.20.5/1.20.6.booleanisMohist()Checks if the server is running on Mohist.booleanisPaper()boolean
-
Field Details
-
version
The version of the server or plugin.This
Stringholds 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
booleanflag 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
booleanflag 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
booleanflag indicates if the server or plugin supports block data manipulation or retrieval. -
hasPersistentData
private final boolean hasPersistentDataIndicates whether persistent data is supported.This
booleanflag shows if the server or plugin supports the use of persistent data containers. -
hasScoreboardTags
private final boolean hasScoreboardTagsIndicates whether scoreboard tags are supported.This
booleanflag indicates if the server or plugin supports scoreboard tags for entities. -
hasHexColors
private final boolean hasHexColorsIndicates whether hex color codes are supported.This
booleanflag 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
booleanflag indicates if the server or plugin supports compass meta data functionality. -
hasSwingHand
private final boolean hasSwingHandIndicates whether hand swing actions are supported.This
booleanflag shows if the server or plugin supports actions related to hand swings. -
hasWorldHeight
private final boolean hasWorldHeightIndicates whether world height data is supported.This
booleanflag 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
booleanflag 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
booleanflag indicates if the server or plugin supports curse enchantments on items. -
hasParticle
private final boolean hasParticleIndicates whether particle effects are supported.This
booleanflag 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
booleanflag 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
booleanflag 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
booleanflag 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
-