예제 #1
0
  @EventHandler(priority = EventPriority.LOWEST)
  public void entityDamageByEntity(EntityDamageByEntityEvent e) {
    if (e.isCancelled()) return;
    if (!Minegusta.getServer().containsWorld(e.getEntity().getWorld())) return;

    ElfPower arrow = ElfPower.arrowDamage(e);
    DwarfPower axe = DwarfPower.axeBoost(e);
    EnderbornPower bleed = EnderbornPower.bleedBoost(e);
    EnderbornPower pearl = EnderbornPower.enderPearlDamage(e);

    if (arrow.isBowDamage()
        && arrow.isPlayer()
        && arrow.arrowIsFiredByElf()
        && arrow.victimIsLiving()
        && arrow.canPVP()) {
      arrow.applyBowDamage();
    }

    if (axe.isPlayer() && axe.isDwarf() && axe.hasAxe() && axe.canPVP()) {
      axe.applyAxeBoost();
    }

    if (bleed.isPlayer() && bleed.damagerIsEndeborn() && bleed.victimIsLiving() && bleed.canPVP()) {
      bleed.applyBleedBoost();
    }

    if (pearl.isPearl() && pearl.isPlayer() && pearl.entityIsEnderBorn()) {
      pearl.cancelPearlDamage();
    }
  }
예제 #2
0
  @EventHandler
  public void entityDamageEvent(EntityDamageEvent e) {
    if (e.isCancelled()) return;
    if (!Minegusta.getServer().containsWorld(e.getEntity().getWorld())) return;

    DwarfPower arrowWeakness = DwarfPower.arrowWeaknesBoost(e);
    ElfPower fireWeakness = ElfPower.fireDamage(e);
    EnderbornPower fallDamage = EnderbornPower.fallDamageBoost(e);

    if (arrowWeakness.isProjectile()
        && arrowWeakness.isPlayer()
        && arrowWeakness.isDwarf()
        && arrowWeakness.canPVP()) {
      arrowWeakness.applyProjectileWeakness();
    }
    if (fireWeakness.isFireDamage() && fireWeakness.isPlayer() && fireWeakness.isElf()) {
      fireWeakness.applyFireDamage();
    }

    if (fallDamage.isPlayer() && fallDamage.entityIsEnderBorn() && fallDamage.isFallDamage()) {
      fallDamage.cancelFallDamae();
    }
  }