2022-07-30 18:28:24 +02:00
|
|
|
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
|
2023-07-04 10:22:56 +02:00
|
|
|
index 8c98546d13ded3142cc3250391db86694e5835f4..d7327b7e57c5075eb687331c7244d0aae1ac7c98 100644
|
2022-07-30 18:28:24 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -649,6 +649,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2022-07-30 18:28:24 +02:00
|
|
|
|
|
|
|
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
|