Merge please
This commit is contained in:
+10
-12
@@ -14,6 +14,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class LimboCache {
|
||||
@@ -117,9 +119,8 @@ public class LimboCache {
|
||||
* @param name String
|
||||
*/
|
||||
public void deleteLimboPlayer(String name) {
|
||||
if (name == null)
|
||||
return;
|
||||
cache.remove(name);
|
||||
checkNotNull(name);
|
||||
cache.remove(name.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,9 +131,8 @@ public class LimboCache {
|
||||
* @return LimboPlayer
|
||||
*/
|
||||
public LimboPlayer getLimboPlayer(String name) {
|
||||
if (name == null)
|
||||
return null;
|
||||
return cache.get(name);
|
||||
checkNotNull(name);
|
||||
return cache.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,9 +143,8 @@ public class LimboCache {
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean hasLimboPlayer(String name) {
|
||||
if (name == null)
|
||||
return false;
|
||||
return cache.containsKey(name);
|
||||
checkNotNull(name);
|
||||
return cache.containsKey(name.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,9 +153,8 @@ public class LimboCache {
|
||||
* @param player Player
|
||||
*/
|
||||
public void updateLimboPlayer(Player player) {
|
||||
if (this.hasLimboPlayer(player.getName().toLowerCase())) {
|
||||
this.deleteLimboPlayer(player.getName().toLowerCase());
|
||||
}
|
||||
checkNotNull(player);
|
||||
deleteLimboPlayer(player.getName().toLowerCase());
|
||||
addLimboPlayer(player);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user