Global monster drops are retrieved from DropProvider (postgres db)

This commit is contained in:
P0nk
2023-03-16 18:00:21 +01:00
parent cc88d382e6
commit 02aa4a237f
7 changed files with 43 additions and 16 deletions

View File

@@ -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();
}