Fixes reloading of data in YAML database
https://github.com/BentoBoxWorld/addon-limits/issues/6
This commit is contained in:
parent
18a3e21a5b
commit
337635d1d8
2
pom.xml
2
pom.xml
|
@ -2,7 +2,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>world.bentobox</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>limits</artifactId>
|
<artifactId>limits</artifactId>
|
||||||
<version>0.0.2-SNAPSHOT</version>
|
<version>0.0.3-SNAPSHOT</version>
|
||||||
<name>addon-limits</name>
|
<name>addon-limits</name>
|
||||||
<description>An add-on for BentoBox that limits blocks and entities on islands.</description>
|
<description>An add-on for BentoBox that limits blocks and entities on islands.</description>
|
||||||
<url>https://github.com/BentoBoxWorld/addon-level</url>
|
<url>https://github.com/BentoBoxWorld/addon-level</url>
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class BlockLimitsListener implements Listener {
|
||||||
ConfigurationSection limitConfig = addon.getConfig().getConfigurationSection("blocklimits");
|
ConfigurationSection limitConfig = addon.getConfig().getConfigurationSection("blocklimits");
|
||||||
defaultLimitMap = loadLimits(limitConfig);
|
defaultLimitMap = loadLimits(limitConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load specific worlds
|
// Load specific worlds
|
||||||
|
|
||||||
if (addon.getConfig().isConfigurationSection("worlds")) {
|
if (addon.getConfig().isConfigurationSection("worlds")) {
|
||||||
|
@ -257,7 +258,11 @@ public class BlockLimitsListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check default limit map
|
// Check default limit map
|
||||||
if (defaultLimitMap.containsKey(m) && countMap.get(id).isAtLimit(m, defaultLimitMap.get(m))) {
|
if (defaultLimitMap.containsKey(m)
|
||||||
|
&& countMap
|
||||||
|
.get(id)
|
||||||
|
.isAtLimit(m,
|
||||||
|
defaultLimitMap.get(m))) {
|
||||||
return defaultLimitMap.get(m);
|
return defaultLimitMap.get(m);
|
||||||
}
|
}
|
||||||
// No limit
|
// No limit
|
||||||
|
|
|
@ -24,6 +24,9 @@ public class IslandBlockCount implements DataObject {
|
||||||
@Expose
|
@Expose
|
||||||
private Map<Material, Integer> blockCount = new HashMap<>();
|
private Map<Material, Integer> blockCount = new HashMap<>();
|
||||||
|
|
||||||
|
// Required for YAML database
|
||||||
|
public IslandBlockCount() {}
|
||||||
|
|
||||||
public IslandBlockCount(String uniqueId2) {
|
public IslandBlockCount(String uniqueId2) {
|
||||||
this.uniqueId = uniqueId2;
|
this.uniqueId = uniqueId2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue