EliteMobs icon indicating copy to clipboard operation
EliteMobs copied to clipboard

Issue Report: EliteMobs v9.4.0 Causes Asynchronous Chunk Retrieval Error on Leaf Server

Open virgil698 opened this issue 8 months ago • 1 comments

Overview

After enabling parallel-world-tracking in the leaf-global.yml configuration file of Leaf server software, the EliteMobs plugin (version 9.4.0) throws an asynchronous chunk retrieval error. This issue disrupts normal server operations and plugin functionality.

Steps to Reproduce

  1. Enable parallel-world-tracking in the Leaf global configuration.
  2. Install and configure the latest version of EliteMobs (v9.4.0).
  3. Trigger EliteMobs' custom spawn functionality, which attempts to retrieve chunk data asynchronously.

Error Log

[13:37:22 ERROR]: [ca.spottedleaf.moonrise.common.util.TickThread] Thread failed main thread check: Cannot retrieve chunk asynchronously, context=thread=Craft Scheduler Thread - 40 - EliteMobs, world=world, chunk_pos=[-5, 11] - Is tick thread? false; Is server level tick thread? false; Is iterating over levels? true; Are we going to hard throw? true
java.lang.Throwable: null
        at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:65) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftWorld.getHighestBlockYAt(CraftWorld.java:976) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftRegionAccessor.getHighestBlockYAt(CraftRegionAccessor.java:168) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftWorld.getHighestBlockAt(CraftWorld.java:965) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftWorld.getHighestBlockAt(CraftWorld.java:970) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at EliteMobs.jar/com.magmaguy.elitemobs.mobconstructor.CustomSpawn.generateRandomSpawnLocation(CustomSpawn.java:291) ~[EliteMobs.jar:?]
        at EliteMobs.jar/com.magmaguy.elitemobs.mobconstructor.CustomSpawn.generateCustomSpawn(CustomSpawn.java:182) ~[EliteMobs.jar:?]
        at EliteMobs.jar/com.magmaguy.elitemobs.mobconstructor.CustomSpawn$1.run(CustomSpawn.java:114) ~[EliteMobs.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:85) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[leaf-1.21.4.jar:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) ~[?:?]
[13:37:22 WARN]: [EliteMobs] Plugin EliteMobs v9.4.0 generated an exception while executing task 2818
java.lang.IllegalStateException: Thread failed main thread check: Cannot retrieve chunk asynchronously, context=thread=Craft Scheduler Thread - 40 - EliteMobs, world=world, chunk_pos=[-5, 11] - Is tick thread? false; Is server level tick thread? false; Is iterating over levels? true; Are we going to hard throw? true
        at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:66) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftWorld.getHighestBlockYAt(CraftWorld.java:976) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftRegionAccessor.getHighestBlockYAt(CraftRegionAccessor.java:168) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftWorld.getHighestBlockAt(CraftWorld.java:965) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.CraftWorld.getHighestBlockAt(CraftWorld.java:970) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at EliteMobs.jar/com.magmaguy.elitemobs.mobconstructor.CustomSpawn.generateRandomSpawnLocation(CustomSpawn.java:291) ~[EliteMobs.jar:?]
        at EliteMobs.jar/com.magmaguy.elitemobs.mobconstructor.CustomSpawn.generateCustomSpawn(CustomSpawn.java:182) ~[EliteMobs.jar:?]
        at EliteMobs.jar/com.magmaguy.elitemobs.mobconstructor.CustomSpawn$1.run(CustomSpawn.java:114) ~[EliteMobs.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:85) ~[leaf-1.21.4.jar:1.21.4-329-124dc64]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[leaf-1.21.4.jar:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) ~[?:?]

Server Configuration

Problem Analysis

The error occurs because EliteMobs attempts to retrieve chunk data asynchronously, which is not allowed in Minecraft server environments. This violates the server's thread safety requirements, leading to the IllegalStateException.

Additional Information

  • The issue is reproducible and impacts server stability.
  • Other plugins and server functionalities work normally when EliteMobs is disabled.
  • The Leaf server is up-to-date with the latest dependencies and optimizations.

virgil698 avatar Apr 25 '25 06:04 virgil698