Skip to content

Commit

Permalink
Set api-version to 1.13 in plugin.yml & Support servers with no CB re…
Browse files Browse the repository at this point in the history
…location.
  • Loading branch information
BlueTree242 committed Mar 22, 2024
1 parent eea02d6 commit 8a7af4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions spigot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ bukkit {
main = "dev.bluetree242.advancedplhide.spigot.AdvancedPlHideSpigot"
author = "BlueTree242"
depend = listOf("ProtocolLib")
apiVersion = "1.13"
commands {
register("advancedplhide") {
aliases = listOf("aph", "plhide", "ph")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ public void onEnable() {
platformPlugin.reloadConfig();
protocolManager.addPacketListener(new SpigotPacketListener(this));
getServer().getPluginManager().registerEvents(new SpigotEventListener(this), this);
String str = Bukkit.getServer().getClass().getPackage().getName();
str = str.substring(str.lastIndexOf("v"));
legacy = (str.equals("v1_8_R3") || str.contains("v1_9_R") || str.contains("v1_10_R1") || str.contains("v1_11_R1") || str.contains("v1_12_R1"));
String mv = Bukkit.getServer().getBukkitVersion();
legacy = (mv.startsWith("1.8") || mv.startsWith("1.9") || mv.startsWith("1.10") || mv.startsWith("1.11") || mv .startsWith("1.12"));
if (!legacy) {
if (Bukkit.getServer().getVersion().equals("v1_19_R1")) {
modernHandler = new V1_19_NMS_Handler();
Expand Down

0 comments on commit 8a7af4e

Please sign in to comment.