Log Minecraft Internal Scheduler logs correctly

This commit is contained in:
Aikar
2020-06-28 05:34:23 -04:00
parent c09346c798
commit 900f77fa66
3 changed files with 33 additions and 21 deletions

View File

@@ -267,29 +267,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.plugin.IllegalPluginAccessException;
import org.bukkit.plugin.Plugin;
@@ -0,0 +0,0 @@ public class CraftScheduler implements BukkitScheduler {
try {
task.run();
} catch (final Throwable throwable) {
+ // Paper start
+ String msg = String.format(
+ "Task #%s for %s generated an exception",
+ task.getTaskId(),
+ task.getOwner().getDescription().getFullName());
task.getOwner().getLogger().log(
Level.WARNING,
- String.format(
- "Task #%s for %s generated an exception",
- task.getTaskId(),
- task.getOwner().getDescription().getFullName()),
+ msg,
msg,
throwable);
}
+ task.getOwner().getServer().getPluginManager().callEvent(
+ new ServerExceptionEvent(new ServerSchedulerException(msg, throwable, task))
+ );
+ // Paper end
+ new ServerExceptionEvent(new ServerSchedulerException(msg, throwable, task)));
// Paper end
} finally {
currentTask = null;
}
@@ -0,0 +0,0 @@ public class CraftScheduler implements BukkitScheduler {
parsePending();
} else {
debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass()));