File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/main/java/world/bentobox/level Expand file tree Collapse file tree 2 files changed +8
-3
lines changed 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