Skip to content

Commit

Permalink
Added 1.21.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Aug 12, 2024
1 parent dab0ce2 commit 903084e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.willfp.eco.core.version.Version;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -35,6 +36,13 @@ private ProxyConstants() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}

private static String convertVersion(@NotNull final String version) {
return switch (version) {
case "v1_21_1" -> "v1_21";
default -> version;
};
}

static {
String currentMinecraftVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
String nmsVersion;
Expand All @@ -45,6 +53,6 @@ private ProxyConstants() {
nmsVersion = "v" + currentMinecraftVersion.replace(".", "_");
}

NMS_VERSION = nmsVersion;
NMS_VERSION = convertVersion(nmsVersion);
}
}

0 comments on commit 903084e

Please sign in to comment.