Handles rogue spawn reports with an error message. Fixes #1052
This commit is contained in:
1 parent
16f3832d16
commit
92063fa891
1 file changed
+6
@@ -1,5 +1,6 @@
|
|||||||
package carpet.utils;
|
package carpet.utils;
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||||
@@ -85,6 +86,11 @@ public class SpawnReporter
|
|||||||
long count = spawn_stats.get(key).getOrDefault(mob.getType(), 0L);
|
long count = spawn_stats.get(key).getOrDefault(mob.getType(), 0L);
|
||||||
spawn_stats.get(key).put(mob.getType(), count + 1);
|
spawn_stats.get(key).put(mob.getType(), count + 1);
|
||||||
spawned_mobs.get(key).put(Pair.of(mob.getType(), pos));
|
spawned_mobs.get(key).put(Pair.of(mob.getType(), pos));
|
||||||
|
if (!local_spawns.containsKey(cat))
|
||||||
|
{
|
||||||
|
CarpetSettings.LOG.error("Rogue spawn detected for category "+cat.getName()+" for mob "+mob.getType().getName().getString()+". If you see this message let carpet peeps know about it on github issues.");
|
||||||
|
local_spawns.put(cat, 0L);
|
||||||
|
}
|
||||||
local_spawns.put(cat, local_spawns.get(cat)+1);
|
local_spawns.put(cat, local_spawns.get(cat)+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user