Skip to content

Commit

Permalink
fix CraftScheduler internal plugin logging issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumine1909 committed Jul 29, 2024
1 parent a1fb5ff commit 8c042c5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ index 0ab53d46f0b8f3f3791dd01766738522c86932e8..f60301047fc22fb72413fe95eb89e4d2
if (event.isCancelled()) {
return event;
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 22f1ed383313829b8af4badda9ef8dc85cae8fd1..03af280bffbd2070abaf1de4b0c963899a67854c 100644
index 22f1ed383313829b8af4badda9ef8dc85cae8fd1..1c47e320e464af9651953ff308a2583fcb965891 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -1,7 +1,7 @@
Expand Down Expand Up @@ -534,6 +534,25 @@ index 22f1ed383313829b8af4badda9ef8dc85cae8fd1..03af280bffbd2070abaf1de4b0c96389
/**
* The start ID for the counter.
*/
@@ -478,10 +480,14 @@ public class CraftScheduler implements BukkitScheduler {
"Task #%s for %s generated an exception",
task.getTaskId(),
task.getOwner().getDescription().getFullName());
- task.getOwner().getLogger().log(
- Level.WARNING,
- logMessage,
- throwable);
+ if (task.getOwner() instanceof MinecraftInternalPlugin) {
+ net.minecraft.server.MinecraftServer.LOGGER.error(logMessage, throwable);
+ } else {
+ task.getOwner().getLogger().log(
+ Level.WARNING,
+ logMessage,
+ throwable);
+ }
org.bukkit.Bukkit.getServer().getPluginManager().callEvent(
new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerSchedulerException(logMessage, throwable, task)));
// Paper end
diff --git a/src/main/java/org/leavesmc/leaves/bot/BotCommand.java b/src/main/java/org/leavesmc/leaves/bot/BotCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..b64361c4151659d5e3f8884562cb811d60776c38
Expand Down

0 comments on commit 8c042c5

Please sign in to comment.