From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> 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 e29b53dcf0db8eda8ad7f494ce188cde28fc5fea..c874c4143945e8a46cf3cdd8af758700a62845ec 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -653,6 +653,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end - sendOpLevel API + // Paper start - custom chat completions API + @Override + public void addAdditionalChatCompletions(@NotNull Collection 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 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");