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
|
2024-11-09 21:17:42 +01:00
|
|
|
index c87aed470ce2964815cb39f804e95f6c03553aba..ddf28d7fbecc70f4cba5f71d7d1d5908b4ad3c3a 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
|
2024-11-09 21:17:42 +01:00
|
|
|
@@ -696,6 +696,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2022-07-30 18:28:24 +02:00
|
|
|
}
|
2024-01-19 22:13:42 +01:00
|
|
|
// Paper end - Add sendOpLevel API
|
2023-11-04 21:20:13 +01:00
|
|
|
|
|
|
|
+ // Paper start - custom chat completions API
|
2022-07-30 18:28:24 +02:00
|
|
|
+ @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)
|
|
|
|
+ ));
|
|
|
|
+ }
|
2023-11-04 21:20:13 +01:00
|
|
|
+ // Paper end - custom chat completions API
|
|
|
|
+
|
2022-07-30 18:28:24 +02:00
|
|
|
@Override
|
2023-11-04 21:20:13 +01:00
|
|
|
public void setCompassTarget(Location loc) {
|
|
|
|
Preconditions.checkArgument(loc != null, "Location cannot be null");
|