Ejemplo n.º 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();
    }
  }
Ejemplo n.º 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();
    }
  }
Ejemplo n.º 3
0
  @EventHandler
  public void entityMountEvent(EntityMountEvent e) {
    if (!Minegusta.getServer().containsWorld(e.getEntity().getWorld())) return;

    ElfPower mount = ElfPower.horseMount(e);

    if (mount.isPlayer() && mount.isElf() && mount.isHorse()) {
      mount.applyTameBoost();
    }
  }
Ejemplo n.º 4
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();
    }
  }
Ejemplo n.º 5
0
  @EventHandler(priority = EventPriority.HIGHEST)
  public void onPlayerChatEvent(AsyncPlayerChatEvent e) {
    if (e.isCancelled()) return;
    if (!Minegusta.getServer().containsWorld(e.getPlayer().getWorld())) return;

    EnderbornInfect enderbornInfect = EnderbornInfect.enderbornInfect(e);

    if (enderbornInfect.isSpell()
        && enderbornInfect.isHuman()
        && enderbornInfect.hasEyesOfEnder()) {
      enderbornInfect.makeEnderborn();
    }
  }
Ejemplo n.º 6
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());
    }
  }
Ejemplo n.º 7
0
  @EventHandler
  public void playerEatEvent(PlayerItemConsumeEvent e) {
    if (!Minegusta.getServer().containsWorld(e.getPlayer().getWorld())) return;

    ElfPower fruit = ElfPower.consumeFruit(e);

    ElfInfect food = ElfInfect.elfInfect(e);

    if (fruit.isPlayer() && fruit.isElf() && fruit.isFruit()) {
      fruit.applyFoodRegenBoost();
    }

    if (food.isHuman() && food.hasLore() && food.isVeganStew()) {
      food.makeElf();
    }
  }
Ejemplo n.º 8
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();
    }
  }
Ejemplo n.º 9
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();
    }
  }