Exemplo n.º 1
0
 @Override
 public void handle(S handle) {
   final PoreEventWrapper wrapper = PoreEventWrapper.get(handle);
   for (RegisteredPoreEvent<?, S> event : this.events) {
     // Check if the event accepts this special event
     for (org.bukkit.event.Event bukkitEvent : wrapper.get(handle, event)) {
       call(bukkitEvent, this.priority);
     }
   }
 }
Exemplo n.º 2
0
  @Override
  public void handle(T handle) {
    org.bukkit.event.Event event = PoreEventWrapper.get(handle);
    if (event == null) {
      PoreEventWrapper.set(handle, event = constructor.construct(handle));
    }

    if (event
        .isValid()) { // verify the Bukkit event is applicable to the particular wrapped Sponge
                      // event
      PoreEventWrapper.call(event, priority);
    }
  }