[ci skip] Fixup last commit

This commit is contained in:
Nassim Jahnke 2024-01-24 14:05:59 +01:00
parent ad2cf68a7f
commit d405ff1255
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
10 changed files with 65 additions and 87 deletions

View File

@ -62,24 +62,24 @@ index 49294a8d580d891f21d8d4cbae14ae477c01ff8d..74937603e7b8308fd314d650d9d966e8
public double getHeight() {
return this.getHandle().getBbHeight();
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 231b4e3552b17f7803815a433a5ece440c227cc6..fd3fe8f00981230f1115ad6821a6be9c9f09f7d3 100644
index 231b4e3552b17f7803815a433a5ece440c227cc6..4bfc2f1729e45e36307a98bd69de9c820123cb8e 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -130,6 +130,17 @@ public class WatchdogThread extends Thread
}
log.log( Level.SEVERE, "\tStack:" );
//
+ // Paper start - Warn in watchdog if an excessive velocity was ever set
+ if (org.bukkit.craftbukkit.CraftServer.excessiveVelEx != null) {
+ log.log(Level.SEVERE, "------------------------------");
+ log.log(Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity");
+ log.log(Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated");
+ log.log(Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
+ for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
+ log.log( Level.SEVERE, "\t\t" + stack );
+ }
+ }
+ // Paper end
for ( StackTraceElement stack : thread.getStackTrace() )
{
log.log( Level.SEVERE, "\t\t" + stack );
@@ -81,6 +81,17 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
}
//
+ // Paper start - Warn in watchdog if an excessive velocity was ever set
+ if (org.bukkit.craftbukkit.CraftServer.excessiveVelEx != null) {
+ log.log(Level.SEVERE, "------------------------------");
+ log.log(Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity");
+ log.log(Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated");
+ log.log(Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
+ for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
+ log.log( Level.SEVERE, "\t\t" + stack );
+ }
+ }
+ // Paper end
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );

View File

@ -19,23 +19,22 @@ index 66994aa135037919219e0bbcabe7de9f6f2c9dcd..140d6e455c1729f6e31e95facba5520b
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..a7bf0ce6eefa60ba61975afb8885fc1857fb7959 100644
index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..50a285127ee5a247680d4486ec9d5e01453b8a8e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -132,6 +132,12 @@ public class RegionFileStorage implements AutoCloseable {
@@ -132,6 +132,11 @@ public class RegionFileStorage implements AutoCloseable {
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
+ // Paper start - Chunk save reattempt
+ int attempts = 0;
+ Exception lastException = null;
+ while (attempts++ < 5) {
+ try {
+ while (attempts++ < 5) { try {
+ // Paper end - Chunk save reattempt
if (nbt == null) {
regionfile.clear(pos);
@@ -156,7 +162,18 @@ public class RegionFileStorage implements AutoCloseable {
@@ -156,7 +161,18 @@ public class RegionFileStorage implements AutoCloseable {
dataoutputstream.close();
}
}

View File

@ -66,7 +66,7 @@ index 9c5c19ab9dc14d844631f47a93f3349409efdf43..56dbc23f10d946a7ec992b08fd868f3e
public static boolean bungee;
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index ab3279be007553cface478795ace34e455615c7b..703787fd9392685c7d8ff9635a29a0b057e2ea5c 100644
index ce17005f8c255eb3096736ef9f0d1de64b612d79..017c2eadbc5dfec155c21b5d8a80f0b1e380398e 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -14,6 +14,10 @@ public class WatchdogThread extends Thread
@ -110,21 +110,10 @@ index ab3279be007553cface478795ace34e455615c7b..703787fd9392685c7d8ff9635a29a0b0
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
@@ -81,29 +96,56 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
@@ -92,29 +107,45 @@ public class WatchdogThread extends Thread
}
}
//
+ // Paper start - Warn in watchdog if an excessive velocity was ever set
+ if (org.bukkit.craftbukkit.CraftServer.excessiveVelEx != null) {
+ log.log( Level.SEVERE, "------------------------------" );
+ log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
+ log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
+ log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
+ for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
+ log.log(Level.SEVERE, "\t\t" + stack);
+ }
+ }
+ // Paper end
// Paper end
+ } else
+ {
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---");

View File

@ -194,14 +194,14 @@ index 0000000000000000000000000000000000000000..0bb4aaa546939b67a5d22865190f3047
+ }
+}
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index 830978f3409888302ab857161628cee5869efa8f..ae51993e0de706cb62c96795ca9de7663893a5bf 100644
index 830978f3409888302ab857161628cee5869efa8f..43573b5ef76c8bb42411c3707cb13d90d531b905 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -39,6 +39,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("version"), new VersionCommand());
commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
commands.put(Set.of("fixlight"), new FixLightCommand());
+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
+ commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
return commands.entrySet().stream()
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))

View File

@ -638,28 +638,22 @@ index 3c1992e212a6d6f1db4d5b807b38d71913619fc0..9c1aff17aabd062640e3f451a2ef8c50
CraftAsyncScheduler() {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 703787fd9392685c7d8ff9635a29a0b057e2ea5c..9994d8b26ffaff538f39cc72f2137fcabb973d87 100644
index 017c2eadbc5dfec155c21b5d8a80f0b1e380398e..b1ac7338fa632611ea8332044b09070f78f8f5f1 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -102,7 +102,7 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
log.log(Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity");
log.log(Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated");
log.log(Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
- for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
+ for (StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace())) { // Paper
log.log(Level.SEVERE, "\t\t" + stack);
log.log( Level.SEVERE, "\t\t" + stack );
}
}
@@ -178,12 +178,12 @@ public class WatchdogThread extends Thread
log.log(Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity");
log.log(Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated");
log.log(Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
- for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
+ for (StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace())) { // Paper
log.log( Level.SEVERE, "\t\t" + stack );
}
@@ -172,7 +172,7 @@ public class WatchdogThread extends Thread
}
// Paper end
log.log( Level.SEVERE, "\tStack:" );
//
- for ( StackTraceElement stack : thread.getStackTrace() )
+ for ( StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(thread.getStackTrace()) ) // Paper
{

View File

@ -6,13 +6,13 @@ Subject: [PATCH] Paper dumpitem command
Let's you quickly view the item in your hands NBT data
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index ae51993e0de706cb62c96795ca9de7663893a5bf..cfa2c49c554e73a44ed52b5e659c17100e14a6ac 100644
index 43573b5ef76c8bb42411c3707cb13d90d531b905..a27c90ea7af63b0d42f202ed1a7dab6e42daed9f 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -40,6 +40,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
commands.put(Set.of("fixlight"), new FixLightCommand());
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
+ commands.put(Set.of("dumpitem"), new DumpItemCommand());
return commands.entrySet().stream()

View File

@ -15282,18 +15282,17 @@ index 0000000000000000000000000000000000000000..f7b0e2564ac4bd2db1d2b2bdc230c9f5
+ }
+}
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index cfa2c49c554e73a44ed52b5e659c17100e14a6ac..b333809320ebfb7a5c4367cb621510f213a69479 100644
index a27c90ea7af63b0d42f202ed1a7dab6e42daed9f..8ff2bcfa05641a022aceff66f2356744caa594da 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -39,7 +39,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("version"), new VersionCommand());
commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
@@ -41,6 +41,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("fixlight"), new FixLightCommand());
- commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); //
commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
commands.put(Set.of("dumpitem"), new DumpItemCommand());
+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
return commands.entrySet().stream()
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
diff --git a/src/main/java/io/papermc/paper/command/subcommands/ChunkDebugCommand.java b/src/main/java/io/papermc/paper/command/subcommands/ChunkDebugCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..962d3cae6340fc11607b59355e291629618f289c
@ -22013,7 +22012,7 @@ index 140d6e455c1729f6e31e95facba5520b75ad838c..f3d169436ce05f1c56599cfe15a56671
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 50f8e12c964a7a0f388568e4df512ddffdda4a64..f54663cdd00064cc3130a27f93e1ea815dc617de 100644
index b5b7b73048eaadfe58961631427da7574d42f5e8..bebcda728952bc0a644b401cd8e003761681e441 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -25,30 +25,98 @@ public class RegionFileStorage implements AutoCloseable {
@ -22144,7 +22143,7 @@ index 50f8e12c964a7a0f388568e4df512ddffdda4a64..f54663cdd00064cc3130a27f93e1ea81
}
public void scanChunk(ChunkPos chunkPos, StreamTagVisitor scanner) throws IOException {
@@ -131,7 +203,12 @@ public class RegionFileStorage implements AutoCloseable {
@@ -131,7 +203,13 @@ public class RegionFileStorage implements AutoCloseable {
}
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
@ -22154,23 +22153,20 @@ index 50f8e12c964a7a0f388568e4df512ddffdda4a64..f54663cdd00064cc3130a27f93e1ea81
+ if (nbt == null && regionfile == null) {
+ return;
+ }
+ try { // Try finally to unlock the region file
+ // Paper end - rewrite chunk system
// Paper start - Chunk save reattempt
int attempts = 0;
Exception lastException = null;
@@ -166,6 +243,10 @@ public class RegionFileStorage implements AutoCloseable {
return;
} catch (Exception ex) {
lastException = ex;
+ // Paper start - rewrite chunk system
+ } finally {
+ regionfile.fileLock.unlock();
+ // Paper end - rewrite chunk system
}
@@ -173,9 +251,14 @@ public class RegionFileStorage implements AutoCloseable {
net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk {}", pos, lastException);
}
@@ -176,7 +257,7 @@ public class RegionFileStorage implements AutoCloseable {
// Paper end - Chunk save reattempt
+ // Paper start - rewrite chunk system
+ } finally {
+ regionfile.fileLock.unlock();
+ }
+ // Paper end - rewrite chunk system
}
- public void close() throws IOException {
@ -22178,7 +22174,7 @@ index 50f8e12c964a7a0f388568e4df512ddffdda4a64..f54663cdd00064cc3130a27f93e1ea81
ExceptionCollector<IOException> exceptionsuppressor = new ExceptionCollector<>();
ObjectIterator objectiterator = this.regionCache.values().iterator();
@@ -193,7 +274,7 @@ public class RegionFileStorage implements AutoCloseable {
@@ -192,7 +275,7 @@ public class RegionFileStorage implements AutoCloseable {
exceptionsuppressor.throwIfPresent();
}
@ -23003,7 +22999,7 @@ index 78669fa035b7537ff7e533cf32aaf2995625424f..05e94702e42b8f5c35d2a112c486d579
throw new IllegalStateException( "Asynchronous " + reason + "!" );
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 9994d8b26ffaff538f39cc72f2137fcabb973d87..de0ad206e8603a7d5b5d5ec3e87d5cab47714eb8 100644
index b1ac7338fa632611ea8332044b09070f78f8f5f1..a284d3b8526a743ba4389ec5b44d80af6d0e5a5f 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -8,7 +8,7 @@ import java.util.logging.Logger;

View File

@ -10,13 +10,13 @@ Also has a hover text on each mob category listing what entity types are
in said category
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index b333809320ebfb7a5c4367cb621510f213a69479..d105489b583aee849748cd13f8e95083ab27843e 100644
index 8ff2bcfa05641a022aceff66f2356744caa594da..b2a15f0346c84b03c8947e3231cf0d27a790ebc9 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -41,6 +41,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("fixlight"), new FixLightCommand());
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); //
@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
commands.put(Set.of("dumpitem"), new DumpItemCommand());
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
+ commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand());
return commands.entrySet().stream()

View File

@ -44,7 +44,7 @@ index f3d169436ce05f1c56599cfe15a56671b7d13516..4d5ab1771129114ef1e4745c43a4fd18
public void close() throws IOException {
ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 480dc0dc8892004edf00b51f57fc639e839453fa..0b17369dda00b415ed15c7215f222b891a1dc2ee 100644
index 6bcf61c287e6c9ee270279e78e38c7fcb17d453f..59441847d70075efc0fe9272532133872f49559c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -246,10 +246,17 @@ public class RegionFileStorage implements AutoCloseable {
@ -78,7 +78,7 @@ index 480dc0dc8892004edf00b51f57fc639e839453fa..0b17369dda00b415ed15c7215f222b89
}
// Paper start - Chunk save reattempt
return;
@@ -307,4 +311,13 @@ public class RegionFileStorage implements AutoCloseable {
@@ -308,4 +312,13 @@ public class RegionFileStorage implements AutoCloseable {
}
}

View File

@ -6,12 +6,12 @@ Subject: [PATCH] Add /paper dumplisteners command
Co-authored-by: TwoLeggedCat <80929284+TwoLeggedCat@users.noreply.github.com>
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index d105489b583aee849748cd13f8e95083ab27843e..e166c319812bf6bc3abd350394b2966228d6283e 100644
index b2a15f0346c84b03c8947e3231cf0d27a790ebc9..0698dfd7ac84a3453eba437895acb4f0b45caf70 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); //
@@ -43,6 +43,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("dumpitem"), new DumpItemCommand());
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand());
+ commands.put(Set.of("dumplisteners"), new DumpListenersCommand());