blob: f67595b6291502d2ede1c2fd31c0be5c788dd3a5 [file] [log] [blame] [raw]
package net.glowstone;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Level;
public class GlowConfiguration {
private final GlowServer server;
public GlowConfiguration(GlowServer server) {
this.server = server;
}
private String bukkitVersion;
public String getBukkitVersion() {
if (bukkitVersion == null) {
String result = "Unknown-Version";
InputStream stream = GlowServer.class.getClassLoader().getResourceAsStream("META-INF/maven/org.bukkit/bukkit/pom.properties");
Properties properties = new Properties();
if (stream != null) {
try {
properties.load(stream);
result = properties.getProperty("version");
} catch (IOException ex) {
server.getLogger().log(Level.SEVERE, "Could not get Bukkit version!", ex);
}
}
return bukkitVersion = result;
} else {
return bukkitVersion;
}
}
}