aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-05 11:18:29 +0100
committerNassim Jahnke <[email protected]>2024-12-05 12:20:56 +0100
commite4e24f3335609b38f460ced71d18babcf11bf9cb (patch)
tree51880d664b3444ce26d6f8cdeb3b8219e5616fca /patches/server/0714-Custom-Chat-Completion-Suggestions-API.patch
parentc54c062e6ff742445bf7749c84106ca67090172d (diff)
downloadPaper-e4e24f3335609b38f460ced71d18babcf11bf9cb.tar.gz
Paper-e4e24f3335609b38f460ced71d18babcf11bf9cb.zip
Move around patches again
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");