-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 1.20.6 support. Streamlined server version checking. Added star…
…tup checks to look for Paper server environment. Implemented reflection checks for CraftingStore plugin hooks. Changed version to `2.9.11-SNAPSHOT-01`.
- Loading branch information
1 parent
2d79932
commit f35b00a
Showing
7 changed files
with
178 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package main.java.me.dniym.enums; | ||
|
||
public enum ServerVersion { | ||
|
||
v1_8_R1, | ||
v1_8_R2, | ||
v1_8_R3, | ||
v1_9_R1, | ||
v1_9_R2, | ||
v1_10_R1, | ||
v1_11_R1, | ||
v1_12_R1, | ||
v1_13_R1, | ||
v1_13_R2, | ||
v1_14_R1, | ||
v1_15_R1, | ||
v1_16_R1, | ||
v1_16_R2, | ||
v1_16_R3, | ||
v1_17_R1, | ||
v1_18_R1, | ||
v1_18_R2, | ||
v1_19_R1, | ||
v1_19_R2, | ||
v1_19_R3, | ||
v1_20_R1, | ||
v1_20_R2, | ||
v1_20_R3, | ||
v1_20_R4; | ||
|
||
public boolean serverVersionEqual(ServerVersion version) { | ||
return this.equals(version); | ||
} | ||
|
||
public boolean serverVersionGreaterThanOrEqual(ServerVersion version) { | ||
return this.ordinal() >= version.ordinal(); | ||
} | ||
|
||
|
||
public boolean serverVersionGreaterThan(ServerVersion version1, ServerVersion version2) { | ||
return version1.ordinal() > version2.ordinal(); | ||
} | ||
|
||
public boolean serverVersionLessThan(ServerVersion version1, ServerVersion version2) { | ||
return version1.ordinal() < version2.ordinal(); | ||
} | ||
|
||
public String getServerVersionName() { | ||
return this.name(); | ||
} | ||
|
||
public int getOrdinalServerVersionNumber() { | ||
return this.ordinal(); | ||
} | ||
|
||
public int getServerMajorVersionNumber() { | ||
return Integer.parseInt(this.name().split("_")[1]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters