Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
314916279a | ||
|
|
dbf1a1bb36 |
@@ -58,7 +58,7 @@ public class MonsterInformationProvider {
|
|||||||
|
|
||||||
private final Map<Integer, List<MonsterDropEntry>> drops = new HashMap<>();
|
private final Map<Integer, List<MonsterDropEntry>> drops = new HashMap<>();
|
||||||
private final List<MonsterGlobalDropEntry> globaldrops = new ArrayList<>();
|
private final List<MonsterGlobalDropEntry> globaldrops = new ArrayList<>();
|
||||||
private final Map<Integer, List<MonsterGlobalDropEntry>> continentdrops = new HashMap<>();
|
private final Map<Integer, List<MonsterGlobalDropEntry>> continentDrops = new HashMap<>();
|
||||||
|
|
||||||
private final Map<Integer, List<Integer>> dropsChancePool = new HashMap<>(); // thanks to ronan
|
private final Map<Integer, List<Integer>> dropsChancePool = new HashMap<>(); // thanks to ronan
|
||||||
private final Set<Integer> hasNoMultiEquipDrops = new HashSet<>();
|
private final Set<Integer> hasNoMultiEquipDrops = new HashSet<>();
|
||||||
@@ -76,23 +76,15 @@ public class MonsterInformationProvider {
|
|||||||
retrieveGlobal();
|
retrieveGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final List<MonsterGlobalDropEntry> getRelevantGlobalDrops(int mapid) {
|
public final List<MonsterGlobalDropEntry> getRelevantGlobalDrops(int mapId) {
|
||||||
int continentid = mapid / 100000000;
|
final int continentId = mapId / 100000000;
|
||||||
|
return continentDrops.computeIfAbsent(continentId, this::loadContinentDrops);
|
||||||
List<MonsterGlobalDropEntry> contiItems = continentdrops.get(continentid);
|
|
||||||
if (contiItems == null) { // continent separated global drops found thanks to marcuswoon
|
|
||||||
contiItems = new ArrayList<>();
|
|
||||||
|
|
||||||
for (MonsterGlobalDropEntry e : globaldrops) {
|
|
||||||
if (e.continentid < 0 || e.continentid == continentid) {
|
|
||||||
contiItems.add(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
continentdrops.put(continentid, contiItems);
|
private List<MonsterGlobalDropEntry> loadContinentDrops(int continentId) {
|
||||||
}
|
return globaldrops.stream()
|
||||||
|
.filter(dropEntry -> dropEntry.continentid < 0 || dropEntry.continentid == continentId)
|
||||||
return contiItems;
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void retrieveGlobal() {
|
private void retrieveGlobal() {
|
||||||
@@ -291,7 +283,7 @@ public class MonsterInformationProvider {
|
|||||||
extraMultiEquipDrops.clear();
|
extraMultiEquipDrops.clear();
|
||||||
dropsChancePool.clear();
|
dropsChancePool.clear();
|
||||||
globaldrops.clear();
|
globaldrops.clear();
|
||||||
continentdrops.clear();
|
continentDrops.clear();
|
||||||
retrieveGlobal();
|
retrieveGlobal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -751,7 +751,7 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final MonsterInformationProvider mi = MonsterInformationProvider.getInstance();
|
final MonsterInformationProvider mi = MonsterInformationProvider.getInstance();
|
||||||
final List<MonsterGlobalDropEntry> globalEntry = mi.getRelevantGlobalDrops(this.getId());
|
final List<MonsterGlobalDropEntry> globalEntry = new ArrayList<>(mi.getRelevantGlobalDrops(mapid));
|
||||||
|
|
||||||
final List<MonsterDropEntry> dropEntry = new ArrayList<>();
|
final List<MonsterDropEntry> dropEntry = new ArrayList<>();
|
||||||
final List<MonsterDropEntry> visibleQuestEntry = new ArrayList<>();
|
final List<MonsterDropEntry> visibleQuestEntry = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user