aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch')
-rw-r--r--patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch
new file mode 100644
index 0000000000..3ec8f74557
--- /dev/null
+++ b/patches/server/0714-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 f9ab43049c7885d6d51a69abb08e961270de17e9..0bbd2c533f2c6f42464c058b1eea86d210cbdf93 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -698,6 +698,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");