diff options
author | Jason Penilla <[email protected]> | 2024-09-10 10:52:30 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-10 19:52:30 +0200 |
commit | e945cfe1c5a285475a8b0b37a85829339ac90d1e (patch) | |
tree | 735d97d77e05bfc1ff5dc45d6fbfe10ed0ec7a7e | |
parent | 61fe23cd08c313128e175b417ed567e61ba9d248 (diff) | |
download | Paper-e945cfe1c5a285475a8b0b37a85829339ac90d1e.tar.gz Paper-e945cfe1c5a285475a8b0b37a85829339ac90d1e.zip |
Fix PaperServerListPingEvent#getPlayerSample not being populated or used (#11387)
-rw-r--r-- | patches/server/0174-Implement-extended-PaperServerListPingEvent.patch | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/patches/server/0174-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0174-Implement-extended-PaperServerListPingEvent.patch index 62fccd9459..f7db224cb6 100644 --- a/patches/server/0174-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0174-Implement-extended-PaperServerListPingEvent.patch @@ -60,12 +60,13 @@ index 0000000000000000000000000000000000000000..d926ad804355ee2fdc5910b2505e8671 +} diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..874dcbefea469440a9028ddc399a37c929429f62 +index 0000000000000000000000000000000000000000..30a19d10869f73d67b794e8e4c035bc5c10209e6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java -@@ -0,0 +1,97 @@ +@@ -0,0 +1,105 @@ +package com.destroystokyo.paper.network; + ++import com.destroystokyo.paper.profile.PlayerProfile; +import com.mojang.authlib.GameProfile; +import io.papermc.paper.adventure.AdventureComponent; +import java.util.ArrayList; @@ -79,6 +80,7 @@ index 0000000000000000000000000000000000000000..874dcbefea469440a9028ddc399a37c9 +import net.minecraft.network.protocol.status.ServerStatus; +import net.minecraft.server.MinecraftServer; +import org.bukkit.craftbukkit.util.CraftIconCache; ++import org.jetbrains.annotations.NotNull; + +public final class StandardPaperServerListPingEventImpl extends PaperServerListPingEventImpl { + @@ -104,6 +106,12 @@ index 0000000000000000000000000000000000000000..874dcbefea469440a9028ddc399a37c9 + return sample; + } + ++ @Override ++ public @NotNull List<PlayerProfile> getPlayerSample() { ++ this.getListedPlayers(); // Populate the backing list for the transforming view, and null out originalSample (see getListedPlayers and processRequest) ++ return super.getPlayerSample(); ++ } ++ + private List<GameProfile> getPlayerSampleHandle() { + if (this.originalSample != null) { + return this.originalSample; |