Fix some misc suspicious calls to Collection methods.

This commit is contained in:
md_5 2016-01-17 20:20:48 +11:00
parent 46695f8449
commit 4927bb8c0b
4 changed files with 4 additions and 16 deletions

View File

@ -80,7 +80,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
_entityMap.remove(event.getPlayer().getName());
_entityNameMap.remove(event.getPlayer().getName());
_entityRiding.remove(event.getPlayer().getName());
_loggedIn.remove(event.getPlayer());
_loggedIn.remove(event.getPlayer().getName());
}
@EventHandler(priority = EventPriority.LOW)

View File

@ -136,7 +136,7 @@ public class ObserverManager extends MiniPlugin
if (_observerMap.containsKey(event.getPlayer()))
{
restore(event.getPlayer(), _observerMap.get(event.getPlayer()));
_observerMap.remove(_plugin);
_observerMap.remove(event.getPlayer());
}
}

View File

@ -295,17 +295,7 @@ public class ServerManager extends MiniPlugin
return timeLeft;
}
public void removeServer(String serverName)
{
for (String key : _serverKeyInfoMap.keySet())
{
_serverKeyInfoMap.get(key).remove(serverName);
}
_serverInfoMap.remove(serverName);
}
public void addServerGroup(ServerGroup serverGroup)
{
_serverKeyInfoMap.put(serverGroup.getPrefix(), new HashSet<ServerInfo>());

View File

@ -356,12 +356,10 @@ public class CustomExplosion extends Explosion
if (_fallingBlockExplosion)
{
Collection<org.bukkit.block.Block> blocks = event.GetBlocks();
List<org.bukkit.block.Block> blocks = new ArrayList<>(event.GetBlocks());
if (blocks.size() > _maxFallingBlocks)
{
blocks = new ArrayList<org.bukkit.block.Block>(blocks);
Collections.shuffle((ArrayList) blocks);
int toRemove = blocks.size() - _maxFallingBlocks;