{
if (Current.GameStates.size() > 0)
{
for (String key : Current.GameStates.keySet())
{
GameState gs = Current.GameStates.get(key);
for (String objKey : gs.getMap().getObjectives().keySet())
{
Objective obj = gs.getMap().getObjectives().get(objKey);
Trigger trg = obj.getTrigger();
switch (trg.getType())
{
case BLOCK_BREAK:
ProcessBlockBreak(gs, obj);
break;
case BLOCK_PLACE:
ProcessBlockPlace(gs, obj);
break;
case BLOCK_PLACE_DISTANCE:
ProcessBlockPlaceDistance(gs, obj);
break;
case CRAFT:
ProcessItemCraft(gs, obj);
break;
case MAP_COUNT:
ProcessMapCount(gs, obj);
break;
}
}
for (String loc : Current.MapEntrances.keySet())
{
MapEntrance me = Current.MapEntrances.get(loc);
if (me.getMap().getMapName().equals(gs.getMap().getMapName()))
{
me.getHighScores().put(gs.getPlayer().getName(), gs.getScore());
}
}
if (gs.PendingRemoval)
{
Current.GameWorlds.remove(gs.getWorld().getName());
Current.Plugin.getServer().unloadWorld(gs.getWorld().getName(), true);
KeysToRemove.add(key);
}
}
GameStateData.saveData();
MapEntranceData.SaveMapEntrances();