mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-02-22 23:31:42 +01:00
* Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) 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: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) 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: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) 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. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
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 f46488155d8bd07719a282e4a1027562973dbef6..db2df0f83efa013187529eabfbbeff257012cc76 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 c1fd0149e1c04f33911bef77afa5d1c7938a6048..61d7004e51fcfb5568750665065261295cacd2f7 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1168,7 +1168,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 92836f1200461ba7fff2f8bcb5e1755ec9a0c9ce..da1be1eaed33dde5c1af44ed97f4b46974a7cd01 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerConnection.java
|
|
@@ -167,6 +167,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 886c6321cfa13bc514c8cd80111326dfbe4c0b70..a15e6a25a796b03fbd080ffb9abe13de2833c5d6 100644
|
|
--- a/src/main/java/net/minecraft/world/level/World.java
|
|
+++ b/src/main/java/net/minecraft/world/level/World.java
|
|
@@ -1087,6 +1087,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 1b92b3d2c696fa4ef86a2d2a58eeb447bb3d2739..d29bdfc2288189e43e2ddbfae1b794c6c9a27333 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
|
|
|
|
@@ -265,6 +274,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() )
|