aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch
diff options
context:
space:
mode:
authorNoah van der Aa <[email protected]>2024-10-23 23:12:09 +0200
committerNoah van der Aa <[email protected]>2024-10-23 23:12:09 +0200
commit1dc142534d54bd1ae01060948bd1caad572a9724 (patch)
treeb4025b2554066029dca70d49415e21c23a6e0b96 /patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch
parentcb79de80c4ae2658f5066a0d5d3e94258765dd96 (diff)
downloadPaper-1dc142534d54bd1ae01060948bd1caad572a9724.tar.gz
Paper-1dc142534d54bd1ae01060948bd1caad572a9724.zip
MOOOOORE
Diffstat (limited to 'patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch')
-rw-r--r--patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch
new file mode 100644
index 0000000000..d07b1f664e
--- /dev/null
+++ b/patches/server/0722-Custom-Chat-Completion-Suggestions-API.patch
@@ -0,0 +1,35 @@
+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 884b02409968c22b8d0926ffb195ba050f51f9bc..025c392f2ca89a87f6301d4af64c4d7daec58409 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -704,6 +704,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+ }
+ // Paper end - Add sendOpLevel API
+
++ // Paper start - custom chat completions API
++ @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 - custom chat completions API
++
+ @Override
+ public void setCompassTarget(Location loc) {
+ Preconditions.checkArgument(loc != null, "Location cannot be null");