mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Custom Chat Completion Suggestions API
This commit is contained in:
parent
ce7cf07354
commit
44f8b39a2c
1 changed files with 18 additions and 0 deletions
|
@ -698,6 +698,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
}
|
}
|
||||||
// Paper end - Add sendOpLevel API
|
// Paper end - Add sendOpLevel API
|
||||||
|
|
||||||
|
// Paper start - custom chat completions API
|
||||||
|
@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 - custom chat completions API
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCompassTarget(Location loc) {
|
public void setCompassTarget(Location loc) {
|
||||||
Preconditions.checkArgument(loc != null, "Location cannot be null");
|
Preconditions.checkArgument(loc != null, "Location cannot be null");
|
||||||
|
|
Loading…
Reference in a new issue