mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-17 08:05:25 +01:00
Added Player#sendPluginMessage
This commit is contained in:
parent
92f914ef2d
commit
939d06cfb5
@ -604,6 +604,29 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a plugin message to the player
|
||||
*
|
||||
* @param channel the message channel
|
||||
* @param data the message data
|
||||
*/
|
||||
public void sendPluginMessage(String channel, byte[] data) {
|
||||
PluginMessagePacket pluginMessagePacket = new PluginMessagePacket();
|
||||
pluginMessagePacket.channel = channel;
|
||||
pluginMessagePacket.data = data;
|
||||
playerConnection.sendPacket(pluginMessagePacket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a plugin message to the player
|
||||
*
|
||||
* @param channel the message channel
|
||||
* @param message the message
|
||||
*/
|
||||
public void sendPluginMessage(String channel, String message) {
|
||||
sendPluginMessage(channel, message.getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a {@link BlockBreakAnimationPacket} packet to the player and his viewers
|
||||
* Setting {@code destroyStage} to -1 resets the break animation
|
||||
|
Loading…
Reference in New Issue
Block a user