Do not put a null world at respawn

This commit is contained in:
Xephi 2015-05-04 16:41:50 +02:00
parent db27341832
commit c12643a138
5 changed files with 11 additions and 2 deletions

View File

@ -27,6 +27,11 @@ public class CacheDataSource extends Thread implements DataSource {
cache.put(auth.getNickname(), auth); cache.put(auth.getNickname(), auth);
} }
public void run()
{
this.setName("AuthMeCacheThread");
}
@Override @Override
public synchronized boolean isAuthAvailable(String user) { public synchronized boolean isAuthAvailable(String user) {
if (cache.containsKey(user.toLowerCase())) if (cache.containsKey(user.toLowerCase()))

View File

@ -48,6 +48,7 @@ public class FlatFileThread extends Thread implements DataSource {
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance()); AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
return; return;
} }
this.setName("AuthMeFlatFileThread");
} }
@Override @Override

View File

@ -94,10 +94,11 @@ public class MySQLThread extends Thread implements DataSource {
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance()); AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
return; return;
} }
this.setName("AuthMeMySQLThread");
} }
private synchronized void connect() throws ClassNotFoundException, private synchronized void connect() throws ClassNotFoundException,
SQLException, TimeoutException { SQLException, TimeoutException, NumberFormatException {
Class.forName("com.mysql.jdbc.Driver"); Class.forName("com.mysql.jdbc.Driver");
ConsoleLogger.info("MySQL driver loaded"); ConsoleLogger.info("MySQL driver loaded");
MysqlConnectionPoolDataSource dataSource = new MysqlConnectionPoolDataSource(); MysqlConnectionPoolDataSource dataSource = new MysqlConnectionPoolDataSource();

View File

@ -72,6 +72,7 @@ public class SQLiteThread extends Thread implements DataSource {
AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance()); AuthMe.getInstance().getServer().getPluginManager().disablePlugin(AuthMe.getInstance());
return; return;
} }
this.setName("AuthMeSQLiteThread");
} }
private synchronized void connect() throws ClassNotFoundException, private synchronized void connect() throws ClassNotFoundException,

View File

@ -1177,7 +1177,8 @@ public class AuthMePlayerListener implements Listener {
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
} }
} }
event.setRespawnLocation(spawn); if (spawn != null && spawn.getWorld() != null)
event.setRespawnLocation(spawn);
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)