mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 21:47:55 +01:00
34 lines
1.6 KiB
Diff
34 lines
1.6 KiB
Diff
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 fc77e4bed1257cd7f3617552d591a2736168d47c..d87324ccf3490fff0981336ef7d22071cd573b51 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -665,6 +665,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false);
|
|
}
|
|
+
|
|
+ @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
|
|
|
|
@Override
|