コード例 #1
0
 @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);
   }
 }
コード例 #2
0
  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)) {
      Packet250CustomPayload packet = new Packet250CustomPayload();
      packet.channel = channel;
      packet.length = message.length;
      packet.data = message;
      getHandle().playerNetServerHandler.sendPacketToPlayer(packet);
    }
  }
コード例 #3
0
ファイル: CraftPlayer.java プロジェクト: ktulych/MCPBukkit
  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);
    }
  }