mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 03:48:01 +01:00
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:
parent
a9122ec448
commit
a0632a8f06
@ -1,24 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Date: Mon, 2 Aug 2021 08:52:21 +0200
|
||||
Subject: [PATCH] Fix test not bootstrapping
|
||||
|
||||
Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
|
||||
diff --git a/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java b/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java
|
||||
+++ b/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentCategory;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
-public class EnchantmentTargetTest {
|
||||
+public class EnchantmentTargetTest extends AbstractTestingBase { // Paper
|
||||
|
||||
@Test
|
||||
public void test() {
|
@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public OptionSet options;
|
||||
public org.bukkit.command.ConsoleCommandSender console;
|
||||
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
|
||||
public ConsoleReader reader;
|
||||
- public static int currentTick = (int) (System.currentTimeMillis() / 50);
|
||||
+ public static int currentTick = 0; // Paper - Further improve tick loop
|
||||
|
@ -4,23 +4,6 @@ Date: Wed, 14 Dec 2022 15:52:11 -0800
|
||||
Subject: [PATCH] Improve logging and errors
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Settings<T extends Settings<T>> {
|
||||
}
|
||||
|
||||
public static Properties loadFromFile(Path path) {
|
||||
+ // Paper start
|
||||
+ if (Files.notExists(path)) {
|
||||
+ LOGGER.info("Could not find existing {}. Creating with default values...", path.getFileName());
|
||||
+ return new Properties();
|
||||
+ }
|
||||
+ // Paper end
|
||||
try {
|
||||
Properties properties;
|
||||
Properties properties1;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
|
@ -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
|
||||
|
@ -265,9 +265,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.resources.RegistryOps;
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public org.bukkit.craftbukkit.CraftServer server;
|
||||
public OptionSet options;
|
||||
public org.bukkit.command.ConsoleCommandSender console;
|
||||
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
|
||||
- public ConsoleReader reader;
|
||||
+ //public ConsoleReader reader; // Paper
|
||||
public static int currentTick = 0; // Paper - Further improve tick loop
|
||||
|
@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ private final java.util.Queue<ConsoleInput> serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queuemmands
|
||||
@Nullable
|
||||
private QueryThreadGs4 queryThreadGs4;
|
||||
public final RconConsoleSource rconConsoleSource;
|
||||
// public final RemoteControlCommandListener rconConsoleSource; // CraftBukkit - remove field
|
||||
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
return;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 82af5dc60eae0a6223be15ea4f69c560521c97a9
|
||||
Subproject commit 6b34da8f0c34fb308c825d3e12abf9cf5bac6ab9
|
@ -1 +1 @@
|
||||
Subproject commit b76ceb4f5dbeeedb6e0cff3b4545779b137bc125
|
||||
Subproject commit db4ba289785418d608eeca8dec2013e513adf9ad
|
@ -1 +1 @@
|
||||
Subproject commit 94e187b577b93759e4f46e85c892049a6baa3bcc
|
||||
Subproject commit d2eba2c820b52b742eb542c6d2c4d76e3d743570
|
Loading…
Reference in New Issue
Block a user