diff options
Diffstat (limited to 'patches/server/0837-Custom-Chat-Completion-Suggestions-API.patch')
-rw-r--r-- | patches/server/0837-Custom-Chat-Completion-Suggestions-API.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/server/0837-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0837-Custom-Chat-Completion-Suggestions-API.patch new file mode 100644 index 0000000000..70a7bab286 --- /dev/null +++ b/patches/server/0837-Custom-Chat-Completion-Suggestions-API.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <[email protected]> +Date: Sat, 30 Jul 2022 11:23:05 -0400 +Subject: [PATCH] Custom Chat Completion Suggestions API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 8bdfbe71e2718e0e24b1de048c8e48927fae1e3a..7cea988c9ada598f00e79c834c644d6bf01b4c93 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -652,6 +652,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false); + } ++ ++ @Override ++ public void addAdditionalChatCompletions(@NotNull Collection<String> completions) { ++ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket( ++ net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket.Action.ADD, ++ new ArrayList<>(completions) ++ )); ++ } ++ ++ @Override ++ public void removeAdditionalChatCompletions(@NotNull Collection<String> completions) { ++ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket( ++ net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket.Action.REMOVE, ++ new ArrayList<>(completions) ++ )); ++ } + // Paper end + + @Override |