Warn when NMS versions don't match. Resolves #165

This commit is contained in:
unknown
2014-05-05 00:01:57 +02:00
parent 56b55eb3e2
commit 489549a0ea
4 changed files with 35 additions and 15 deletions

View File

@ -363,6 +363,24 @@ public class TFM_Util
return false;
}
public static void deleteCoreDumps()
{
final File[] coreDumps = new File(".").listFiles(new FileFilter()
{
@Override
public boolean accept(File file)
{
return file.getName().startsWith("java.core");
}
});
for (File dump : coreDumps)
{
TFM_Log.info("Removing core dump file: " + dump.getName());
dump.delete();
}
}
public static EntityType getEntityType(String mobname) throws Exception
{
mobname = mobname.toLowerCase().trim();
@ -881,6 +899,12 @@ public class TFM_Util
return date.getTime() / 1000L;
}
public static String getNmsVersion()
{
String packageName = Bukkit.getServer().getClass().getPackage().getName();
return packageName.substring(packageName.lastIndexOf('.') + 1);
}
public static class TFM_EntityWiper
{
private static final List<Class<? extends Entity>> WIPEABLES = new ArrayList<Class<? extends Entity>>();