mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-16 05:12:31 +08:00
Fix ore dropping and implement subfields
This commit is contained in:
committed by
KingRainbow44
Unverified
parent
9dae3cbcc7
commit
56f09e87a1
@@ -116,6 +116,7 @@ public final class ResourceLoader {
|
||||
loadConfigLevelEntityData();
|
||||
loadQuestShareConfig();
|
||||
loadGadgetMappings();
|
||||
loadSubfieldMappings();
|
||||
loadMonsterMappings();
|
||||
loadActivityCondGroups();
|
||||
loadGroupReplacements();
|
||||
@@ -805,6 +806,38 @@ public final class ResourceLoader {
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadSubfieldMappings() {
|
||||
try {
|
||||
val subfieldMap = GameData.getSubfieldMappingMap();
|
||||
try {
|
||||
JsonUtils.loadToList(getResourcePath("Server/SubfieldMapping.json"), SubfieldMapping.class).forEach(entry -> subfieldMap.put(entry.getEntityId(), entry));;
|
||||
} catch (IOException | NullPointerException ignored) {}
|
||||
Grasscutter.getLogger().debug("Loaded {} subfield mappings.", subfieldMap.size());
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Unable to load subfield mappings.", e);
|
||||
}
|
||||
|
||||
try {
|
||||
val dropSubfieldMap = GameData.getDropSubfieldMappingMap();
|
||||
try {
|
||||
JsonUtils.loadToList(getResourcePath("Server/DropSubfieldMapping.json"), DropSubfieldMapping.class).forEach(entry -> dropSubfieldMap.put(entry.getDropId(), entry));;
|
||||
} catch (IOException | NullPointerException ignored) {}
|
||||
Grasscutter.getLogger().debug("Loaded {} drop subfield mappings.", dropSubfieldMap.size());
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Unable to load drop subfield mappings.", e);
|
||||
}
|
||||
|
||||
try {
|
||||
val dropTableExcelConfigDataMap = GameData.getDropTableExcelConfigDataMap();
|
||||
try {
|
||||
JsonUtils.loadToList(getResourcePath("Server/DropTableExcelConfigData.json"), DropTableExcelConfigData.class).forEach(entry -> dropTableExcelConfigDataMap.put(entry.getId(), entry));;
|
||||
} catch (IOException | NullPointerException ignored) {}
|
||||
Grasscutter.getLogger().debug("Loaded {} drop table configs.", dropTableExcelConfigDataMap.size());
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Unable to load drop table config data.", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadMonsterMappings() {
|
||||
try {
|
||||
var monsterMap = GameData.getMonsterMappingMap();
|
||||
|
||||
Reference in New Issue
Block a user