Fix some misc suspicious calls to Collection methods.
This commit is contained in:
parent
46695f8449
commit
4927bb8c0b
@ -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)
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>());
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user