Package com.bergerkiller.bukkit.common.events

Examples of com.bergerkiller.bukkit.common.events.PacketSendEvent


    // Handle listeners
    PacketType type = PacketType.getType(packet);
    List<PacketListener> listenerList = listeners.get(type);
    if (listenerList != null) {
      CommonPacket cp = new CommonPacket(packet, type);
      PacketSendEvent ev = new PacketSendEvent(player, cp);
      ev.setCancelled(wasCancelled);
      for (PacketListener listener : listenerList) {
        listener.onPacketSend(ev);
      }
      if (ev.isCancelled()) {
        return false;
      }
    }
    // Handle monitors
    handlePacketSendMonitor(player, type, packet);
View Full Code Here


    }

    @Override
    public void onPacketSending(PacketEvent event) {
      CommonPacket packet = new CommonPacket(event.getPacket().getHandle());
      PacketSendEvent sendEvent = new PacketSendEvent(event.getPlayer(), packet);
      sendEvent.setCancelled(event.isCancelled());
      listener.onPacketSend(sendEvent);
      event.setCancelled(sendEvent.isCancelled());
    }
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.common.events.PacketSendEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.