Global monster drops are retrieved from DropProvider (postgres db)
This commit is contained in:
@@ -38,7 +38,14 @@ public class DropProvider {
|
||||
monsterDrop.maxQuantity(), questId);
|
||||
}
|
||||
|
||||
public List<MonsterGlobalDropEntry> getGlobalDropEntries() {
|
||||
public List<MonsterGlobalDropEntry> getRelevantGlobalDrops(int mapId) {
|
||||
int continentId = mapId / 100_000_000;
|
||||
return getGlobalDropEntries().stream()
|
||||
.filter(drop -> drop.continentid < 0 || drop.continentid == continentId)
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<MonsterGlobalDropEntry> getGlobalDropEntries() {
|
||||
if (this.globalMonsterDrops == null) {
|
||||
loadGlobalDrops();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ public class MonsterInformationProvider {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private final Map<Integer, List<MonsterDropEntry>> drops = new HashMap<>();
|
||||
private final List<MonsterGlobalDropEntry> globaldrops = new ArrayList<>();
|
||||
private final Map<Integer, List<MonsterGlobalDropEntry>> continentdrops = new HashMap<>();
|
||||
|
||||
@@ -179,7 +178,6 @@ public class MonsterInformationProvider {
|
||||
}
|
||||
|
||||
public final void clearDrops() {
|
||||
drops.clear();
|
||||
globaldrops.clear();
|
||||
continentdrops.clear();
|
||||
retrieveGlobal();
|
||||
|
||||
@@ -729,8 +729,7 @@ public class MapleMap {
|
||||
chRate = 1;
|
||||
}
|
||||
|
||||
final MonsterInformationProvider mi = MonsterInformationProvider.getInstance();
|
||||
final List<MonsterGlobalDropEntry> globalEntry = mi.getRelevantGlobalDrops(this.getId());
|
||||
final List<MonsterGlobalDropEntry> globalEntry = dropProvider.getRelevantGlobalDrops(this.getId());
|
||||
|
||||
final List<MonsterDropEntry> dropEntry = new ArrayList<>();
|
||||
final List<MonsterDropEntry> visibleQuestEntry = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user