当前位置: 首页>>代码示例>>Java>>正文


Java StandardMessenger.validatePluginMessage方法代码示例

本文整理汇总了Java中org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage方法的典型用法代码示例。如果您正苦于以下问题:Java StandardMessenger.validatePluginMessage方法的具体用法?Java StandardMessenger.validatePluginMessage怎么用?Java StandardMessenger.validatePluginMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.plugin.messaging.StandardMessenger的用法示例。


在下文中一共展示了StandardMessenger.validatePluginMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:10,代码来源:CraftPlayer.java

示例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);
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:8,代码来源:CraftWorld.java

示例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);
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:9,代码来源:CraftServer.java

示例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);
       }
}
 
开发者ID:DevotedMC,项目名称:ExilePearl,代码行数:9,代码来源:TestServer.java

示例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);
    }
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:8,代码来源:CanaryServer.java

示例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);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:10,代码来源:CraftPlayer.java

示例7: 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);
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:13,代码来源:CraftPlayer.java

示例8: 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);
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:11,代码来源:CraftPlayer.java

示例9: 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().field_71135_a == null) return;

    if (channels.contains(channel)) {
        net.minecraft.network.packet.Packet250CustomPayload packet = new net.minecraft.network.packet.Packet250CustomPayload();
        packet.field_73630_a = channel;
        packet.field_73628_b = message.length;
        packet.field_73629_c = message;
        getHandle().field_71135_a.func_72567_b(packet);
    }
}
 
开发者ID:agaricusb,项目名称:MCPBukkit,代码行数:13,代码来源:CraftPlayer.java


注:本文中的org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。