Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CraftScheduler internal plugin logging issue #284

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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