From 4c723932f6c2a6f3c1947ba0363d344c6c1e3036 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 15 Dec 2024 12:13:09 +0100 Subject: [PATCH] Small fixups --- .../selector/EntitySelectorParser.java.patch | 11 +++++--- .../chat/SignedMessageChain.java.patch | 9 +++---- .../dedicated/DedicatedServer.java.patch | 27 ++++++++----------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch b/paper-server/patches/sources/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch index 33d39ea636..7274630b68 100644 --- a/paper-server/patches/sources/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch +++ b/paper-server/patches/sources/net/minecraft/commands/arguments/selector/EntitySelectorParser.java.patch @@ -1,14 +1,17 @@ --- a/net/minecraft/commands/arguments/selector/EntitySelectorParser.java +++ b/net/minecraft/commands/arguments/selector/EntitySelectorParser.java -@@ -122,7 +_,7 @@ +@@ -122,6 +_,11 @@ } public static boolean allowSelectors(S suggestionProvider) { -- return suggestionProvider instanceof SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.hasPermission(2); -+ return suggestionProvider instanceof net.minecraft.commands.CommandSourceStack stack ? stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector") : suggestionProvider instanceof net.minecraft.commands.SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.hasPermission(2); // Paper - Fix EntityArgument permissions ++ // Paper start - Fix EntityArgument permissions ++ if (suggestionProvider instanceof net.minecraft.commands.CommandSourceStack stack) { ++ return stack.bypassSelectorPermissions || stack.hasPermission(2, "minecraft.command.selector"); ++ } ++ // Paper end - Fix EntityArgument permissions + return suggestionProvider instanceof SharedSuggestionProvider sharedSuggestionProvider && sharedSuggestionProvider.hasPermission(2); } - public EntitySelector getSelector() { @@ -198,8 +_,10 @@ }; } diff --git a/paper-server/patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch b/paper-server/patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch index 39e328fbef..440e3748c5 100644 --- a/paper-server/patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch +++ b/paper-server/patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch @@ -22,16 +22,15 @@ static final Component OUT_OF_ORDER_CHAT = Component.translatable("chat.disabled.out_of_order_chat"); - public DecodeException(Component component) { -- super(component); + // Paper start + public final org.bukkit.event.player.PlayerKickEvent.Cause kickCause; -+ public DecodeException(Component message, org.bukkit.event.player.PlayerKickEvent.Cause event) { -+ super(message); ++ public DecodeException(Component component, org.bukkit.event.player.PlayerKickEvent.Cause event) { + super(component); + this.kickCause = event; + } + // Paper end -+ public DecodeException(Component message) { -+ this(message, org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); // Paper ++ public DecodeException(Component component) { ++ this(component, org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); // Paper } } diff --git a/paper-server/patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch b/paper-server/patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch index 6608a2eae4..def9b71a6f 100644 --- a/paper-server/patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -13,25 +13,20 @@ @Nullable private RconThread rconThread; public DedicatedServerSettings settings; -@@ -80,19 +_,12 @@ - private DebugSampleSubscriptionTracker debugSampleSubscriptionTracker; +@@ -81,6 +_,7 @@ public ServerLinks serverLinks; -- public DedicatedServer( -- Thread serverThread, -- LevelStorageSource.LevelStorageAccess storageSource, -- PackRepository packRepository, -- WorldStem worldStem, -- DedicatedServerSettings settings, -- DataFixer fixerUpper, -- Services services, -- ChunkProgressListenerFactory progressListenerFactory -- ) { + public DedicatedServer( ++ joptsimple.OptionSet options, net.minecraft.server.WorldLoader.DataLoadContext worldLoader, // CraftBukkit - Signature changed + Thread serverThread, + LevelStorageSource.LevelStorageAccess storageSource, + PackRepository packRepository, +@@ -90,9 +_,9 @@ + Services services, + ChunkProgressListenerFactory progressListenerFactory + ) { - super(serverThread, storageSource, packRepository, worldStem, Proxy.NO_PROXY, fixerUpper, services, progressListenerFactory); -+ // CraftBukkit start - Signature changed -+ public DedicatedServer(joptsimple.OptionSet options, net.minecraft.server.WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings settings, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { -+ super(options, worldLoader, thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, services, worldloadlistenerfactory); -+ // CraftBukkit end ++ super(options, worldLoader, serverThread, storageSource, packRepository, worldStem, Proxy.NO_PROXY, fixerUpper, services, progressListenerFactory); // CraftBukkit - Signature changed this.settings = settings; - this.rconConsoleSource = new RconConsoleSource(this); + //this.rconConsoleSource = new RconConsoleSource(this); // CraftBukkit - remove field