mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 00:37:55 +00:00
Update Context.java
This commit is contained in:
@@ -72,6 +72,13 @@ public class Context {
|
||||
this.defaultErr = System.err;
|
||||
}
|
||||
|
||||
public static double getJavaVersion() {
|
||||
String version = System.getProperty("java.version");
|
||||
int pos = version.indexOf('.');
|
||||
pos = version.indexOf('.', pos+1);
|
||||
return Double.parseDouble (version.substring (0, pos));
|
||||
}
|
||||
|
||||
public static Context getInstance(ServerProvider serverProvider) {
|
||||
return instance == null ? instance = new Context(serverProvider) : instance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user