bukkit
버전
수색…
런타임에 버전 가져 오기
@Override
public void onEnable() {
String version = Bukkit.getBukkitVersion(); //The string version of this bukkit server
}
여러 구현 버전에서 NMS 액세스
// gets the Class objects from the net.mminecraft.server package with the given name
public Class<?> getNmsClass(String name) throws ClassNotFoundException {
// explode the Server interface implementation's package name into its components
String[] packageArray = Bukkit.getServer().getClass().getPackage().getName().split("\\.");
// pick out the component representing the package version if it's present
String packageVersion = array.length == 4 ? array[3] + "." : "";
// construct the qualified class name from the obtained package version
String qualName = "net.minecraft.server." + packageVersion + name;
// simple call to get the Class object
return Class.forName(qualName);
}
Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow