Enum MinecraftVersion
- java.lang.Object
-
- java.lang.Enum<MinecraftVersion>
-
- io.github.thebusybiscuit.slimefun4.api.MinecraftVersion
-
- All Implemented Interfaces:
Serializable
,Comparable<MinecraftVersion>
public enum MinecraftVersion extends Enum<MinecraftVersion>
This enum holds all versions of Minecraft that we currently support.- Author:
- TheBusyBiscuit
- See Also:
SlimefunPlugin
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MINECRAFT_1_13
This constant represents Minecraft (Java Edition) Version 1.14 (The Update Aquatic)MINECRAFT_1_14
This constant represents Minecraft (Java Edition) Version 1.14 (The "Village & Pillage" Update)MINECRAFT_1_15
This constant represents Minecraft (Java Edition) Version 1.15 (The "Buzzy Bees" Update)UNKNOWN
This constant represents an exceptional state in which we were unable to identify the Minecraft Version we are using
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
This returns the name of thisMinecraftVersion
in a readable format.boolean
isAtLeast(MinecraftVersion version)
This method checks whether thisMinecraftVersion
is newer or equal to the givenMinecraftVersion
,boolean
matches(String version)
This method checks whether the given version matches with thisMinecraftVersion
.static MinecraftVersion
valueOf(String name)
Returns the enum constant of this type with the specified name.static MinecraftVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MINECRAFT_1_13
public static final MinecraftVersion MINECRAFT_1_13
This constant represents Minecraft (Java Edition) Version 1.14 (The Update Aquatic)
-
MINECRAFT_1_14
public static final MinecraftVersion MINECRAFT_1_14
This constant represents Minecraft (Java Edition) Version 1.14 (The "Village & Pillage" Update)
-
MINECRAFT_1_15
public static final MinecraftVersion MINECRAFT_1_15
This constant represents Minecraft (Java Edition) Version 1.15 (The "Buzzy Bees" Update)
-
UNKNOWN
public static final MinecraftVersion UNKNOWN
This constant represents an exceptional state in which we were unable to identify the Minecraft Version we are using
-
-
Method Detail
-
values
public static MinecraftVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MinecraftVersion c : MinecraftVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MinecraftVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
public String getName()
This returns the name of thisMinecraftVersion
in a readable format.- Returns:
- The name of this
MinecraftVersion
-
matches
public boolean matches(String version)
This method checks whether the given version matches with thisMinecraftVersion
.- Parameters:
version
- The version to compare- Returns:
- Whether the version matches with this one
-
isAtLeast
public boolean isAtLeast(MinecraftVersion version)
This method checks whether thisMinecraftVersion
is newer or equal to the givenMinecraftVersion
,- Parameters:
version
- TheMinecraftVersion
to compare- Returns:
- Whether this
MinecraftVersion
is newer or equal to the givenMinecraftVersion
-
-