public static void handleMap(MapleMap map, int numTimes, int size, long now) { if (map.getItemsSize() > 0) { for (MapleMapItem item : map.getAllItemsThreadsafe()) { if (item.shouldExpire(now)) { item.expire(map); } else if (item.shouldFFA(now)) { item.setDropType((byte) 2); } } } if (map.getCharactersSize() > 0 || map.getId() == 931000500) { if (map.canSpawn(now)) { map.respawn(false, now); } boolean hurt = map.canHurt(now); boolean canrune = true; for (MapleCharacter chr : map.getCharactersThreadsafe()) { handleCooldowns(chr, numTimes, hurt, now); } if (map.getMobsSize() > 0) { for (MapleMonster mons : map.getAllMonstersThreadsafe()) { if (mons.getStats().isBoss()) { canrune = false; } if ((mons.isAlive()) && (mons.shouldKill(now))) { map.killMonster(mons); } else if ((mons.isAlive()) && (mons.shouldDrop(now))) { mons.doDropItem(now); } else if ((mons.isAlive()) && (mons.getStatiSize() > 0)) { for (MonsterStatusEffect mse : mons.getAllBuffs()) { if (mse.shouldCancel(now)) { mons.cancelSingleStatus(mse); } } } } } } }