Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9648)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
6b34da8f SPIGOT-7467: Add getAddress to RemoteConsoleCommandSender

CraftBukkit Changes:
db4ba2897 SPIGOT-7467: Add getAddress to RemoteConsoleCommandSender
4f7ff4dec PR-1246: Add missing AbstractTestingBase to tests which need them
f70a7b68d SPIGOT-7465, MC-264979: Fresh installations print NoSuchFileException for server.properties
8ef7afef6 PR-1240: Call BlockGrowEvent for vines that are growing on additional sides of an existing vine block

Spigot Changes:
d2eba2c8 Rebuild patches
This commit is contained in:
Noah van der Aa
2023-08-28 13:05:48 +02:00
parent a9122ec448
commit a0632a8f06
9 changed files with 26 additions and 62 deletions

View File

@@ -934,7 +934,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
+import co.aikar.timings.MinecraftTimings; // Paper
import org.bukkit.event.server.ServerCommandEvent;
+import org.bukkit.craftbukkit.util.Waitable;
+import org.bukkit.craftbukkit.util.Waitable; // Paper
import org.bukkit.event.server.RemoteServerCommandEvent;
// CraftBukkit end
@@ -957,21 +957,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
@Override
public String runCommand(String command) {
+ Waitable[] waitableArray = new Waitable[1];
this.rconConsoleSource.prepareForCommand();
public String runCommand(RconConsoleSource rconConsoleSource, String s) {
+ Waitable[] waitableArray = new Waitable[1]; // Paper
rconConsoleSource.prepareForCommand();
+ final java.util.concurrent.atomic.AtomicReference<String> command = new java.util.concurrent.atomic.AtomicReference<>(s); // Paper
this.executeBlocking(() -> {
// CraftBukkit start - fire RemoteServerCommandEvent
CommandSourceStack wrapper = rconConsoleSource.createCommandSourceStack();
RemoteServerCommandEvent event = new RemoteServerCommandEvent(rconConsoleSource.getBukkitSender(wrapper), s);
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (event.isCancelled()) {
return;
}
- ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper);
- server.dispatchServerCommand(event.getSender(), serverCommand);
+
+ // Paper start
+ if (command.toLowerCase().startsWith("timings") && command.toLowerCase().matches("timings (report|paste|get|merged|seperate)")) {
+ command.set(event.getCommand());
+ if (event.getCommand().toLowerCase().startsWith("timings") && event.getCommand().toLowerCase().matches("timings (report|paste|get|merged|seperate)")) {
+ org.bukkit.command.BufferedCommandSender sender = new org.bukkit.command.BufferedCommandSender();
+ Waitable<String> waitable = new Waitable<String>() {
+ Waitable<String> waitable = new Waitable<>() {
+ @Override
+ protected String evaluate() {
+ return sender.getBuffer();
@@ -981,10 +987,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ co.aikar.timings.Timings.generateReport(new co.aikar.timings.TimingsReportListener(sender, waitable));
+ } else {
+ // Paper end
ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), this.rconConsoleSource.createCommandSourceStack());
server.dispatchServerCommand(remoteConsole, serverCommand);
+ ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper);
+ server.dispatchServerCommand(event.getSender(), serverCommand);
+ } // Paper
// CraftBukkit end
});
+ // Paper start
+ if (waitableArray[0] != null) {
@@ -993,17 +998,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ try {
+ return waitable.get();
+ } catch (java.util.concurrent.ExecutionException e) {
+ throw new RuntimeException("Exception processing rcon command " + command, e.getCause());
+ throw new RuntimeException("Exception processing rcon command " + command.get(), e.getCause());
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt(); // Maintain interrupted state
+ throw new RuntimeException("Interrupted processing rcon command " + command, e);
+ throw new RuntimeException("Interrupted processing rcon command " + command.get(), e);
+ }
+
+ }
+ // Paper end
return this.rconConsoleSource.getCommandResponse();
return rconConsoleSource.getCommandResponse();
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java