mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-12-26 02:17:41 +01:00
Fixes bug where island world settings in config were not used
https://github.com/BentoBoxWorld/Level/issues/80
This commit is contained in:
parent
378a855bde
commit
8e2f4a4b5e
@ -191,12 +191,8 @@ public class CalcIslandLevel {
|
||||
result.ofCount.add(md);
|
||||
return 0;
|
||||
}
|
||||
} else if (addon.getSettings().getBlockValues().containsKey(md)) {
|
||||
return getValue(md);
|
||||
} else {
|
||||
result.ncCount.add(md);
|
||||
return 0;
|
||||
}
|
||||
return getValue(md);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -206,10 +202,17 @@ public class CalcIslandLevel {
|
||||
* @return value of a material
|
||||
*/
|
||||
private int getValue(Material md) {
|
||||
// Check world settings
|
||||
if (addon.getSettings().getWorldBlockValues().containsKey(world) && addon.getSettings().getWorldBlockValues().get(world).containsKey(md)) {
|
||||
return addon.getSettings().getWorldBlockValues().get(world).get(md);
|
||||
}
|
||||
return addon.getSettings().getBlockValues().getOrDefault(md, 0);
|
||||
// Check baseline
|
||||
if (addon.getSettings().getBlockValues().containsKey(md)) {
|
||||
return addon.getSettings().getBlockValues().get(md);
|
||||
}
|
||||
// Not in config
|
||||
result.ncCount.add(md);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,7 +109,7 @@ public class Settings {
|
||||
for (String material : worldValues.getKeys(false)) {
|
||||
Material mat = Material.valueOf(material);
|
||||
Map<Material, Integer> values = worldBlockValues.getOrDefault(bWorld, new HashMap<>());
|
||||
values.put(mat, worldValues.getInt("blocks." + material, 0));
|
||||
values.put(mat, worldValues.getInt(material));
|
||||
worldBlockValues.put(bWorld, values);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user