mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Do not attempt to load an empty treasure config
This commit is contained in:
parent
1b461ac96a
commit
e3e4cf9884
@ -52,6 +52,11 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
Map<String, Treasure> treasures = new HashMap<String, Treasure>();
|
Map<String, Treasure> treasures = new HashMap<String, Treasure>();
|
||||||
ConfigurationSection treasureSection = config.getConfigurationSection("Treasures");
|
ConfigurationSection treasureSection = config.getConfigurationSection("Treasures");
|
||||||
|
|
||||||
|
if (treasureSection == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Set<String> treasureConfigSet = treasureSection.getKeys(false);
|
Set<String> treasureConfigSet = treasureSection.getKeys(false);
|
||||||
|
|
||||||
for (String treasureName : treasureConfigSet) {
|
for (String treasureName : treasureConfigSet) {
|
||||||
@ -211,14 +216,14 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
Treasure treasure = nextEntry.getValue();
|
Treasure treasure = nextEntry.getValue();
|
||||||
|
|
||||||
if (treasure instanceof FishingTreasure) {
|
if (treasure instanceof FishingTreasure) {
|
||||||
if (!fishingTreasures.contains(treasureKey)) {
|
if (fishingTreasures == null || !fishingTreasures.contains(treasureKey)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fishingRewards.add((FishingTreasure) treasure);
|
fishingRewards.add((FishingTreasure) treasure);
|
||||||
}
|
}
|
||||||
else if (treasure instanceof HylianTreasure) {
|
else if (treasure instanceof HylianTreasure) {
|
||||||
if (!hylianTreasures.contains(treasureKey)) {
|
if (hylianTreasures == null || !hylianTreasures.contains(treasureKey)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +242,7 @@ public class TreasureConfig extends ConfigLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (treasure instanceof ExcavationTreasure) {
|
else if (treasure instanceof ExcavationTreasure) {
|
||||||
if (!excavationTreasures.contains(treasureKey)) {
|
if (excavationTreasures == null || !excavationTreasures.contains(treasureKey)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user