File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
src/main/java/world/bentobox/level Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 5555 <powermock .version>2.0.9</powermock .version>
5656 <!-- More visible way how to change dependency versions -->
5757 <spigot .version>1.21.5-R0.1-SNAPSHOT</spigot .version>
58- <bentobox .version>3.3.1 </bentobox .version>
58+ <bentobox .version>3.4.0 </bentobox .version>
5959 <!-- Warps addon version -->
6060 <warps .version>1.12.0</warps .version>
6161 <!-- Visit addon version -->
6767 <!-- Do not change unless you want different name for local builds. -->
6868 <build .number>-LOCAL</build .number>
6969 <!-- This allows to change between versions. -->
70- <build .version>2.21.1 </build .version>
70+ <build .version>2.21.2 </build .version>
7171 <sonar .projectKey>BentoBoxWorld_Level</sonar .projectKey>
7272 <sonar .organization>bentobox-world</sonar .organization>
7373 <sonar .host.url>https://sonarcloud.io</sonar .host.url>
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ private List<String> getReport() {
272272 while (it .hasNext ()) {
273273
274274 Entry <Object > type = it .next ();
275- Integer limit = addon .getBlockConfig ().getLimit (type );
275+ Integer limit = addon .getBlockConfig ().getLimit (type . getElement () );
276276 String explain = ")" ;
277277 reportLines .add (Util .prettifyText (type .toString ()) + ": " + String .format ("%,d" , type .getCount ())
278278 + " blocks (max " + limit + explain );
@@ -374,7 +374,10 @@ private int limitCountAndValue(Object obj) {
374374 }
375375
376376 int count = limitCount .getOrDefault (obj , 0 );
377+
377378 if (count > limit ) {
379+ // Add block to ofCount
380+ this .results .ofCount .add (obj );
378381 return 0 ;
379382 }
380383 limitCount .put (obj , count + 1 );
Original file line number Diff line number Diff line change 1919import org .bukkit .configuration .file .YamlConfiguration ;
2020import org .bukkit .entity .EntityType ;
2121
22+ import world .bentobox .bentobox .BentoBox ;
2223import world .bentobox .bentobox .hooks .ItemsAdderHook ;
2324import world .bentobox .level .Level ;
2425
@@ -177,14 +178,15 @@ private void loadWorlds(YamlConfiguration blockValues2) {
177178 */
178179 public Integer getLimit (Object obj ) {
179180 if (obj instanceof Material m ) {
180- return blockLimits .get (m .name ());
181+ return blockLimits .get (m .getKey (). getKey ());
181182 }
182183 if (obj instanceof EntityType et ) {
183- return blockLimits .get (et .name ().concat (SPAWNER ));
184+ return blockLimits .get (et .name ().toLowerCase ( Locale . ENGLISH ). concat (SPAWNER ));
184185 }
185186 if (obj instanceof String s ) {
186187 return blockLimits .get (s );
187188 }
189+
188190 return null ;
189191 }
190192
You can’t perform that action at this time.
0 commit comments