本文整理汇总了Java中org.bukkit.plugin.messaging.StandardMessenger类的典型用法代码示例。如果您正苦于以下问题:Java StandardMessenger类的具体用法?Java StandardMessenger怎么用?Java StandardMessenger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StandardMessenger类属于org.bukkit.plugin.messaging包,在下文中一共展示了StandardMessenger类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
if (getHandle().playerNetServerHandler == null) return;
if (channels.contains(channel)) {
net.minecraft.network.play.server.S3FPacketCustomPayload packet = new net.minecraft.network.play.server.S3FPacketCustomPayload(channel, message);
getHandle().playerNetServerHandler.sendPacket(packet);
}
}
示例2: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
for (Player player : getPlayers()) {
player.sendPluginMessage(source, channel, message);
}
}
示例3: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
@Override
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(getMessenger(), source, channel, message);
for (Player player : getOnlinePlayers()) {
player.sendPluginMessage(source, channel, message);
}
}
示例4: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
@Override
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(getMessenger(), source, channel, message);
for (Player player : getOnlinePlayers()) {
player.sendPluginMessage(source, channel, message);
}
}
示例5: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(getMessenger(), source, channel, message);
for (Player player : getOnlinePlayers()) {
player.sendPluginMessage(source, channel, message);
}
}
示例6: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
if (getHandle().playerConnection == null) return;
if (channels.contains(channel)) {
PacketPlayOutCustomPayload packet = new PacketPlayOutCustomPayload(channel, message);
getHandle().playerConnection.sendPacket(packet);
}
}
示例7: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
@Override
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
if (getHandle().playerConnection == null) return;
if (channels.contains(channel)) {
PacketPlayOutCustomPayload packet = new PacketPlayOutCustomPayload(channel, new PacketDataSerializer(Unpooled.wrappedBuffer(message)));
getHandle().playerConnection.sendPacket(packet);
}
}
示例8: sendPluginMessage
import org.bukkit.plugin.messaging.StandardMessenger; //导入依赖的package包/类
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
if (getHandle().playerConnection == null) return;
if (channels.contains(channel)) {
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.tag = channel;
packet.length = message.length;
packet.data = message;
getHandle().playerConnection.sendPacket(packet);
}
}