Ejemplo n.º 1
0
 @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
 public void onPaintingBreak(PaintingBreakEvent event) {
   // TODO: Should we fire a left click before firing the painting break?
   OccurredEvent drop = new OccurredEvent(event);
   Log.logInfo("PaintingBreak drop occurance created. (" + drop.toString() + ")", HIGHEST);
   parent.sectionManager.performDrop(drop);
 }
Ejemplo n.º 2
0
  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onEntityDeath(EntityDeathEvent event) {
    // TODO: use get getLastDamageCause rather than checking on each
    // getdamage?
    Log.logInfo(
        "*** OnEntityDeath, before checks (victim: " + event.getEntity().toString() + ")", HIGHEST);
    Entity entity = event.getEntity();

    // If there's no damage record, ignore
    if (entity.getLastDamageCause() == null) {
      Log.logWarning(
          "OnEntityDeath: entity " + entity.toString() + " has no 'lastDamageCause'.", HIGH);
      return;
    }

    OccurredEvent drop = new OccurredEvent(event);
    Log.logInfo("EntityDeath drop occurance created. (" + drop.toString() + ")", HIGHEST);
    parent.sectionManager.performDrop(drop);
  }