Package me.lucko.shadow.bukkit
Enum PackageVersion
- java.lang.Object
-
- java.lang.Enum<PackageVersion>
-
- me.lucko.shadow.bukkit.PackageVersion
-
- All Implemented Interfaces:
Serializable,Comparable<PackageVersion>
public enum PackageVersion extends Enum<PackageVersion>
An enumeration of CraftBukkit package versions.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @NonNull StringgetPackageComponent()booleanisAfter(@NonNull PackageVersion other)Gets if this version comes after theotherversion.booleanisAfterOrEq(@NonNull PackageVersion other)Gets if this version is the same as or comes after theotherversion.booleanisBefore(@NonNull PackageVersion other)Gets if this version comes before theotherversion.booleanisBeforeOrEq(@NonNull PackageVersion other)Gets if this version is the same as or comes before theotherversion.@NonNull Stringnms(@NonNull String className)Prepends the versioned NMS prefix to the given class name@NonNull Class<?>nmsClass(@NonNull String className)Prepends the versioned NMS prefix to the given class name@NonNull Stringobc(@NonNull String className)Prepends the versioned OBC prefix to the given class name@NonNull Class<?>obcClass(@NonNull String className)Prepends the versioned OBC prefix to the given class namestatic @NonNull PackageVersionruntimeVersion()Gets the package version for the current runtime server instance.static PackageVersionvalueOf(String name)Returns the enum constant of this type with the specified name.static PackageVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final PackageVersion NONE
-
v1_7_R1
public static final PackageVersion v1_7_R1
-
v1_7_R2
public static final PackageVersion v1_7_R2
-
v1_7_R3
public static final PackageVersion v1_7_R3
-
v1_7_R4
public static final PackageVersion v1_7_R4
-
v1_8_R1
public static final PackageVersion v1_8_R1
-
v1_8_R2
public static final PackageVersion v1_8_R2
-
v1_8_R3
public static final PackageVersion v1_8_R3
-
v1_9_R1
public static final PackageVersion v1_9_R1
-
v1_9_R2
public static final PackageVersion v1_9_R2
-
v1_10_R1
public static final PackageVersion v1_10_R1
-
v1_11_R1
public static final PackageVersion v1_11_R1
-
v1_12_R1
public static final PackageVersion v1_12_R1
-
v1_13_R1
public static final PackageVersion v1_13_R1
-
v1_13_R2
public static final PackageVersion v1_13_R2
-
v1_14_R1
public static final PackageVersion v1_14_R1
-
v1_15_R1
public static final PackageVersion v1_15_R1
-
v1_16_R1
public static final PackageVersion v1_16_R1
-
v1_16_R2
public static final PackageVersion v1_16_R2
-
v1_16_R3
public static final PackageVersion v1_16_R3
-
v1_17_R1
public static final PackageVersion v1_17_R1
-
v1_18_R1
public static final PackageVersion v1_18_R1
-
v1_18_R2
public static final PackageVersion v1_18_R2
-
v1_19_R1
public static final PackageVersion v1_19_R1
-
v1_19_R2
public static final PackageVersion v1_19_R2
-
v1_19_R3
public static final PackageVersion v1_19_R3
-
v1_20_R1
public static final PackageVersion v1_20_R1
-
-
Field Detail
-
NMS
public static final String NMS
The nms prefix (without the version component)- See Also:
- Constant Field Values
-
NMS_MODERN
public static final String NMS_MODERN
The nms prefix for 1.17+ (excludes version component)- See Also:
- Constant Field Values
-
OBC
public static final String OBC
The obc prefix (without the version component)- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static PackageVersion[] 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 (PackageVersion c : PackageVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PackageVersion 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
-
getPackageComponent
protected @NonNull String getPackageComponent()
-
nms
public @NonNull String nms(@NonNull String className)
Prepends the versioned NMS prefix to the given class name- Parameters:
className- the name of the class- Returns:
- the full class name
-
nmsClass
public @NonNull Class<?> nmsClass(@NonNull String className) throws ClassNotFoundException
Prepends the versioned NMS prefix to the given class name- Parameters:
className- the name of the class- Returns:
- the class represented by the full class name
- Throws:
ClassNotFoundException
-
obc
public @NonNull String obc(@NonNull String className)
Prepends the versioned OBC prefix to the given class name- Parameters:
className- the name of the class- Returns:
- the full class name
-
obcClass
public @NonNull Class<?> obcClass(@NonNull String className) throws ClassNotFoundException
Prepends the versioned OBC prefix to the given class name- Parameters:
className- the name of the class- Returns:
- the class represented by the full class name
- Throws:
ClassNotFoundException
-
isBefore
public boolean isBefore(@NonNull PackageVersion other)
Gets if this version comes before theotherversion.- Parameters:
other- the other version- Returns:
- if it comes before
-
isAfter
public boolean isAfter(@NonNull PackageVersion other)
Gets if this version comes after theotherversion.- Parameters:
other- the other version- Returns:
- if it comes after
-
isBeforeOrEq
public boolean isBeforeOrEq(@NonNull PackageVersion other)
Gets if this version is the same as or comes before theotherversion.- Parameters:
other- the other version- Returns:
- if it comes before or is the same
-
isAfterOrEq
public boolean isAfterOrEq(@NonNull PackageVersion other)
Gets if this version is the same as or comes after theotherversion.- Parameters:
other- the other version- Returns:
- if it comes after or is the same
-
runtimeVersion
public static @NonNull PackageVersion runtimeVersion()
Gets the package version for the current runtime server instance.- Returns:
- the package version of the current runtime
-
-