mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-28 21:56:37 +01:00
22be9f2d6f
* Updated Upstream and Sidestream(s) (Paper/Purpur/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2299159bb Add option to fix items merging through blocks (#5334) d8c20ddc7 Fix PlayerBucketEmptyEvent result itemstack (#5698) ceb3762fb Add PufferFishStateChangeEvent (#5606) cd4defec0 [CI-SKIP] Update version checker to use V2 downloads API (#5728) b9f2a673d Limit item frame cursors on maps (#5730) 81a537c1f Add PlayerKickEvent causes (#5648) b7976b956 Add More Lidded Block API (#5707) Purpur Changes: b88aef3a Fix Paper#4748 - Shulkerbox allow oversized stacks 9fec1bae Updated Upstream (Paper) 2aacc766 Update Toothpick to 1.1.0-SNAPSHOT a08d7470 Configurable anvil cumulative cost (#352) Origami Changes: 3b8adab Fix importing of classes not working if their directory doesn't exist * Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Empirecraft/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 525d0e3d3 fix beacon activate/deactivate events (#5646) e403d6aaf [Auto] Updated Upstream (CraftBukkit) 6bcd8b57c Updated Upstream (CraftBukkit) (#5742) 501cc9448 Reset villager inventory on cancelled pickup event (#5738) 3f72a549b Exit with non-zero exit code when killed by watchdog (#5732) a8d7ad099 Updated Upstream (Bukkit/CraftBukkit) (#5735) Tuinity Changes: e9c8348 Revert entity ticking chunk map for tracker Purpur Changes: 687936be Updated Upstream (Paper) 4c2d7e56 Fix advancement triggers on entity death 49a0fb90 Fix oversized shulker box dupe e92d259e Fix raid captains not giving voluntary exile advancement a97fdc48 Config to broadcast the death message to the affected player (#363) 9bf8e165 Add burn in daylight API for LivingEntity (#331) 96460068 Fix dupe bug caused by SPIGOT-6452 2618c24f Revert "allow disabling offline mode message on an ONLINE MODE proxy" aa79fa5c allow disabling offline mode message on an ONLINE MODE proxy 830141ca Bee can work when raining or at night (#365) ae6ca468 Updated Upstream (Paper) d99cc6e8 [ci-skip] Add better issue templates (#360) Empirecraft Changes: 12009c31 Updated Paper 5305540d Updated Paper 1043bd94 Revert "Call EntityPickupItemEvent for villagers" CB commit 820b9bdf Updated Paper Origami Changes: 64fba4f Fix importing of classes not working if their directory doesn't exist 3b8adab Fix importing of classes not working if their directory doesn't exist * rebuild Patches
208 lines
14 KiB
Diff
208 lines
14 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: ishland <ishlandmc@yeah.net>
|
|
Date: Wed, 27 Jan 2021 23:35:30 +0800
|
|
Subject: [PATCH] Suspected plugins report
|
|
|
|
Added "Suspected Plugins" to Watchdog, crash reports and exception messages
|
|
|
|
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
|
index 9b7a51890c667601b195ff15b2bf0d6c76c7f19f..d7dd6208d1fc47dd95badecaaee0ed98292a5f7f 100644
|
|
--- a/src/main/java/net/minecraft/CrashReport.java
|
|
+++ b/src/main/java/net/minecraft/CrashReport.java
|
|
@@ -87,6 +87,8 @@ public class CrashReport {
|
|
if (this.h != null && this.h.length > 0) {
|
|
stringbuilder.append("-- Head --\n");
|
|
stringbuilder.append("Thread: ").append(Thread.currentThread().getName()).append("\n");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(this.h, stringbuilder::append); // Yatopia - detailed report
|
|
+ stringbuilder.append("\n"); // Yatopia
|
|
stringbuilder.append("Stacktrace:\n");
|
|
StackTraceElement[] astacktraceelement = this.h;
|
|
int i = astacktraceelement.length;
|
|
diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java
|
|
index 1dce5d3b1e994a060067de4901912dd5a9be7e15..c5cc8cee3eaac3410512b678d11c7aaf743ffa35 100644
|
|
--- a/src/main/java/net/minecraft/network/NetworkManager.java
|
|
+++ b/src/main/java/net/minecraft/network/NetworkManager.java
|
|
@@ -423,6 +423,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
|
channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
|
// Paper start
|
|
} catch (Exception e) {
|
|
+ // Yatopia - detailed report
|
|
+ LOGGER.error("Encountered unexpected exception sending packets");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error);
|
|
+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW);
|
|
+ // Yatopia end
|
|
LOGGER.error("NetworkException: " + player, e);
|
|
close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));;
|
|
packet.onPacketDispatchFinish(player, null);
|
|
@@ -462,6 +467,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
|
channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
|
// Paper start
|
|
} catch (Exception e) {
|
|
+ // Yatopia start - detailed report
|
|
+ LOGGER.error("Encountered unexpected exception sending packets");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error);
|
|
+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW);
|
|
+ // Yatopia end
|
|
LOGGER.error("NetworkException: " + player, e);
|
|
close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));;
|
|
packet.onPacketDispatchFinish(player, null);
|
|
@@ -497,6 +507,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
|
channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
|
// Paper start
|
|
} catch (Exception e) {
|
|
+ // Yatopia start - detailed report
|
|
+ LOGGER.error("Encountered unexpected exception sending packets");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error);
|
|
+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW);
|
|
+ // Yatopia end
|
|
LOGGER.error("NetworkException: " + player, e);
|
|
close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));;
|
|
packet.onPacketDispatchFinish(player, null);
|
|
diff --git a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
|
index 71a000edfab27c9965d1929af78582821d5af97a..5c5ac70b4dae5d51303ab974261055aaefb5aec2 100644
|
|
--- a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
|
+++ b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
|
@@ -57,6 +57,11 @@ public class PlayerConnectionUtils {
|
|
// Paper start
|
|
catch (Exception e) {
|
|
NetworkManager networkmanager = t0.a();
|
|
+ // Yatopia start - detailed report
|
|
+ LOGGER.error("Encountered unexpected exception sending packets");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error);
|
|
+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW);
|
|
+ // Yatopia end
|
|
if (networkmanager.getPlayer() != null) {
|
|
LOGGER.error("Error whilst processing packet {} for {}[{}]", packet, networkmanager.getPlayer().getName(), networkmanager.getSocketAddress(), e);
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index ed4a8f34c0f48adb9d90e53ac5c9ca584e400a47..b298b95f96c382dbed29e641740fb4265d6e5587 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1172,7 +1172,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
return;
|
|
}
|
|
// Paper end
|
|
- MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable);
|
|
+ // Yatopia start - detailed report
|
|
+ MinecraftServer.LOGGER.error("Encountered an unexpected exception");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(throwable.getStackTrace(), MinecraftServer.LOGGER::error);
|
|
+ MinecraftServer.LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW, throwable);
|
|
+ // Yatopia end
|
|
// Spigot Start
|
|
if ( throwable.getCause() != null )
|
|
{
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerConnection.java b/src/main/java/net/minecraft/server/network/ServerConnection.java
|
|
index 69a982832489fc78fd46418341bdcba1e2be69e9..7bcaa5be42383cd1f1cfce6457c235a8f7563a5b 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerConnection.java
|
|
@@ -176,6 +176,11 @@ public class ServerConnection {
|
|
throw new ReportedException(CrashReport.a(exception, "Ticking memory connection"));
|
|
}
|
|
|
|
+ // Yatopia start - detailed report
|
|
+ ServerConnection.LOGGER.error("Encountered unexpected exception sending packets");
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(exception, ServerConnection.LOGGER::error);
|
|
+ ServerConnection.LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW);
|
|
+ // Yatopia end
|
|
ServerConnection.LOGGER.warn("Failed to handle packet for {}", networkmanager.getSocketAddress(), exception);
|
|
ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error");
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
|
index c3ae27ed4b1cc7ffb36560112459b0746095befd..eb6c4e3a98783a0a2f0d4e988efd6e326defc29b 100644
|
|
--- a/src/main/java/net/minecraft/world/level/World.java
|
|
+++ b/src/main/java/net/minecraft/world/level/World.java
|
|
@@ -1097,6 +1097,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
|
// Paper start - Prevent tile entity and entity crashes
|
|
String msg = "TileEntity threw exception at " + tileentity.getWorld().getWorld().getName() + ":" + tileentity.getPosition().getX() + "," + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ();
|
|
System.err.println(msg);
|
|
+ // Yatopia start - detailed report
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(throwable, System.err::println);
|
|
+ System.err.println(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW);
|
|
+ // Yatopia end
|
|
throwable.printStackTrace();
|
|
getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
|
|
// Paper end
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
index 0be39dac4b9dd69d7d73d86d64cf1e33e4086e81..c53531bc769ecd39c4f03b7a10c5bc6a48ace081 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
@@ -455,6 +455,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
parsePending();
|
|
while (isReady(currentTick)) {
|
|
final CraftTask task = pending.remove();
|
|
+ lastSyncTask = task; // Yatopia - detailed report
|
|
if (task.getPeriod() < CraftTask.NO_REPEATING) {
|
|
if (task.isSync()) {
|
|
runners.remove(task.getTaskId(), task);
|
|
@@ -473,12 +474,15 @@ public class CraftScheduler implements BukkitScheduler {
|
|
task.getTaskId(),
|
|
task.getOwner().getDescription().getFullName());
|
|
if (task.getOwner() == MINECRAFT) {
|
|
- net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
|
|
+ // Yatopia start - detailed report
|
|
+ net.minecraft.server.MinecraftServer.LOGGER.error(msg);
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(throwable, net.minecraft.server.MinecraftServer.LOGGER::error);
|
|
+ net.minecraft.server.MinecraftServer.LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW, throwable);
|
|
} else {
|
|
- task.getOwner().getLogger().log(
|
|
- Level.WARNING,
|
|
- msg,
|
|
- throwable);
|
|
+ task.getOwner().getLogger().log(Level.SEVERE, msg);
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(throwable, _msg -> task.getOwner().getLogger().log(Level.SEVERE, _msg));
|
|
+ task.getOwner().getLogger().log(Level.SEVERE, org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW, throwable);
|
|
+ // Yatopia end
|
|
}
|
|
org.bukkit.Bukkit.getServer().getPluginManager().callEvent(
|
|
new ServerExceptionEvent(new ServerSchedulerException(msg, throwable, task)));
|
|
@@ -493,6 +497,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
// We don't need to parse pending
|
|
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
|
}
|
|
+ lastSyncTask = null; // Yatopia - detailed report
|
|
final long period = task.getPeriod(); // State consistency
|
|
if (period > 0) {
|
|
task.setNextRun(currentTick + period);
|
|
@@ -646,4 +651,10 @@ public class CraftScheduler implements BukkitScheduler {
|
|
};
|
|
}
|
|
// Paper end
|
|
+ // Yatopia start - detailed report
|
|
+ private volatile CraftTask lastSyncTask = null;
|
|
+ public CraftTask getLastSyncTask() {
|
|
+ return lastSyncTask;
|
|
+ }
|
|
+ // Yatopia end
|
|
}
|
|
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
|
index b15db666281227d1dc486e4e57dae1831fbf78ec..eded1fce68bb021c0b61d3355e6b52d2527679fd 100644
|
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
|
@@ -134,6 +134,15 @@ public class WatchdogThread extends Thread
|
|
log.log(Level.SEVERE, "Handling packet for connection: " + packetListener);
|
|
}
|
|
}
|
|
+ // Yatopia start - detailed report - Scheduler
|
|
+ if (Bukkit.getScheduler() instanceof org.bukkit.craftbukkit.scheduler.CraftScheduler) {
|
|
+ final org.bukkit.craftbukkit.scheduler.CraftScheduler scheduler = (org.bukkit.craftbukkit.scheduler.CraftScheduler) Bukkit.getScheduler();
|
|
+ final org.bukkit.craftbukkit.scheduler.CraftTask lastSyncTask = scheduler.getLastSyncTask();
|
|
+ if (lastSyncTask != null) {
|
|
+ log.log(Level.SEVERE, "Running task " + lastSyncTask.getTaskId() + " for '" + lastSyncTask.getOwner().getDescription().getFullName() + "', TaskClass: " + lastSyncTask.getTaskClass());
|
|
+ }
|
|
+ } else log.log(Level.SEVERE, "Unofficial scheduler, unable to get task information");
|
|
+ // Yatopia end
|
|
}
|
|
// Tuinity end - log detailed tick information
|
|
|
|
@@ -266,6 +275,10 @@ public class WatchdogThread extends Thread
|
|
log.log( Level.SEVERE, "\t\tLocked on:" + monitor.getLockedStackFrame() );
|
|
}
|
|
}
|
|
+ // Yatopia start - dump plugins info
|
|
+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(thread.getStackTrace(), msg -> log.log(Level.SEVERE, msg));
|
|
+ log.log(Level.SEVERE, "");
|
|
+ // Yatopia end
|
|
log.log( Level.SEVERE, "\tStack:" );
|
|
//
|
|
for ( StackTraceElement stack : thread.getStackTrace() )
|