예제 #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 playerBreakBlock(BlockBreakEvent e) {
    if (e.isCancelled()) return;
    if (!Minegusta.getServer().containsWorld(e.getPlayer().getWorld())) return;

    DwarfPower mine = DwarfPower.miningBoost(e);
    if (mine.isPlayer() && mine.isDwarf()) {
      mine.applyMiningBoost();
    }
  }
예제 #3
0
  @EventHandler
  public void playerInteractEntityEvent(PlayerInteractEntityEvent e) {
    if (!Minegusta.getServer().containsWorld(e.getPlayer().getWorld())) return;

    DwarfPower rage = DwarfPower.battleCryBoost(e);

    if (rage.isPlayer() && rage.isDwarf() && rage.hasAxe()) {
      rage.applyBattleCryBoost();
    }
  }
예제 #4
0
  @EventHandler
  public void playerInteractEvent(PlayerInteractEvent e) {
    if (!Minegusta.getServer().containsWorld(e.getPlayer().getWorld())) return;

    DwarfPower rage = DwarfPower.battleCryBoost(e);
    Altar altar = Altar.altarCheck(e);

    if (rage.isRightClick() && rage.isPlayer() && rage.isDwarf() && rage.hasAxe()) {
      rage.applyBattleCryBoost();
    }

    if (altar.isRightClick() && altar.isAltar() && altar.hasDiamondBlocks() && altar.isNotHuman()) {
      Cure.curePlayer(e.getPlayer());
    }
  }
예제 #5
0
  @EventHandler
  public void entityDeathEvent(EntityDeathEvent e) {
    if (!Minegusta.getServer().containsWorld(e.getEntity().getWorld())) return;

    DwarfPower strengthBoost = DwarfPower.strengthBoost(e);

    DwarfInfect dwarfInfect = DwarfInfect.dwarfInfect(e);

    if (strengthBoost.isPlayer() && strengthBoost.killerIsPlayer() && strengthBoost.isDwarf()) {
      strengthBoost.applyStrengthBoost();
    }

    if (dwarfInfect.isByLava() && dwarfInfect.isHuman() && dwarfInfect.hasShinyGem()) {
      dwarfInfect.makeDwarf();
    }
  }
예제 #6
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();
    }
  }