mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 09:39:40 -05:00
Add tool to get NMS version
Former-commit-id: 183143c967dc35c44d1a218179406e760f7f408b [formerly 75514bb09dfaf8273c41a7aa70ad771c50121410] Former-commit-id: c00cf1e8c8ee601e2ac6c7d5e23b2d33a92480f1
This commit is contained in:
1 parent
dc348bcece
commit
014babbb33
1 file changed
+6
-1
@@ -916,7 +916,7 @@ public class Util {
|
||||
|
||||
}
|
||||
|
||||
private static Class<?> getNMSClass(@Nullable String className) {
|
||||
public static Class<?> getNMSClass(@Nullable String className) {
|
||||
if (className == null)
|
||||
className = "MinecraftServer";
|
||||
String name = Bukkit.getServer().getClass().getPackage().getName();
|
||||
@@ -928,6 +928,11 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getNMSVersion() {
|
||||
String name = Bukkit.getServer().getClass().getPackage().getName();
|
||||
return name.substring(name.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
public static boolean isAir(@NotNull Material mat) {
|
||||
if (mat == Material.AIR)
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user