예제 #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 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();
    }
  }
예제 #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();
    }
  }
예제 #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();
    }
  }
예제 #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());
    }
  }
예제 #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();
    }
  }
예제 #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();
    }
  }
예제 #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();
    }
  }