Idk how it can be null, but well ...

This commit is contained in:
Xephi 2015-12-04 17:17:35 +01:00
parent a1f963adf8
commit 0d1cf8c7e2
3 changed files with 12 additions and 2 deletions

View File

@ -117,6 +117,8 @@ public class LimboCache {
* @param name String
*/
public void deleteLimboPlayer(String name) {
if (name == null)
return;
cache.remove(name);
}
@ -128,6 +130,8 @@ public class LimboCache {
* @return LimboPlayer
*/
public LimboPlayer getLimboPlayer(String name) {
if (name == null)
return null;
return cache.get(name);
}
@ -139,6 +143,8 @@ public class LimboCache {
* @return boolean
*/
public boolean hasLimboPlayer(String name) {
if (name == null)
return false;
return cache.containsKey(name);
}

View File

@ -253,8 +253,11 @@ public class AsynchronousJoin {
? m.retrieve(MessageKey.REGISTER_EMAIL_MESSAGE)
: m.retrieve(MessageKey.REGISTER_MESSAGE);
}
BukkitTask msgTask = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgTask);
if (LimboCache.getInstance().getLimboPlayer(name) != null)
{
BukkitTask msgTask = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgTask);
}
}
private boolean needFirstSpawn() {

View File

@ -393,6 +393,7 @@ Protection:
- 'US'
- 'GB'
# Countries blacklisted automatically ( without any needed to enable protection )
# PLEASE USE QUOTES!
countriesBlacklist:
- 'A1'
# Do we need to enable automatic antibot system?