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