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 6e0e0e8405873069274c574240feea793e287f0c..b764d508951e19634aface33b618bd3d3e114479 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -674,6 +674,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false); } + + @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 @Override