示例#1
0
  @Override
  public boolean isBroken(EntityKilledEvent event) {
    boolean ruleBroken = !wolverineMode && event.isTamedCreatureKill();

    if (ruleBroken) {
      LoggerUtil.getInstance()
          .debug("No reward for " + event.getKiller().getName() + " using tamed creatures.");
    }

    return ruleBroken;
  }
示例#2
0
  @Override
  protected boolean isBroken(EntityKilledEvent event) {
    SpawnerMobTracking tracking = event.getSpawnerMobTracking();
    boolean ruleBroken =
        !canCampSpawner && campByEntity && tracking.isSpawnerMob(event.getEntity());
    LoggerUtil.getInstance()
        .debugTrue(
            "No reward for " + event.getKiller().getName() + " spawner camping.", ruleBroken);

    return ruleBroken;
  }
  private boolean hasRewardSource(EntityKilledEvent event) {
    Player killer = event.getKiller();
    LivingEntity entity = event.getEntity();

    if (DependencyUtils.hasPermission(killer, "reward." + entity.getType().getName())) {
      if (hasRewardSource(entity.getType()) && !isRuleBroken(event)) {
        return true;
      }
    } else {
      LoggerUtil.getInstance()
          .debug(
              this.getClass(),
              "No reward for "
                  + killer.getName()
                  + " due to lack of permission for "
                  + entity.getType().getName());
    }

    return false;
  }