Add fancy Player#sendPacket shortcut

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-09-10 05:41:54 +02:00
parent fd027ecfd7
commit e6db47ec6e
1 changed files with 11 additions and 2 deletions

View File

@ -1251,11 +1251,20 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
*
* @return the player connection
*/
@NotNull
public PlayerConnection getPlayerConnection() {
public @NotNull PlayerConnection getPlayerConnection() {
return playerConnection;
}
/**
* Shortcut for {@link PlayerConnection#sendPacket(ServerPacket)}.
*
* @param packet the packet to send
*/
@ApiStatus.Experimental
public void sendPacket(@NotNull ServerPacket packet) {
this.playerConnection.sendPacket(packet);
}
/**
* Gets if the player is online or not.
*