Exemple #1
0
  @Override
  protected void bC() {

    ++this.deathTicks;
    if (this.deathTicks == 20) {
      int i;

      if (!this.world.isClientSide
          && (this.lastDamageByPlayerTime > 0 || this.alwaysGivesExp())
          && this.bd()
          && this.world.getGameRules().getBoolean("doMobLoot")) {
        i = this.getExpValue(this.killer);

        while (i > 0) {
          int j = EntityExperienceOrb.getOrbValue(i);

          i -= j;
          // this.world.addEntity(new EntityExperienceOrb(this.world,
          // this.locX, this.locY, this.locZ, j));
        }

        World world = this.getWorld();
        org.bukkit.World BukkitWorld = world.getWorld();

        if (this.killer instanceof EntityPlayer) {

          Player player = (Player) this.killer.getBukkitEntity();
          int playerLevel = player.getLevel();

          Location loc = new Location(BukkitWorld, this.locX, this.locY, this.locZ);

          for (int orbQuantity = CustomEntityExperienceOrb.getOrbQuantity(playerLevel, MobLevel);
              orbQuantity > 0;
              orbQuantity--) {
            Bukkit.getServer()
                .broadcastMessage("[BETA] Zombie xp orb (" + orbQuantity + ") distribution");

            Entity orb = new CustomEntityExperienceOrb(this.world, this.MobLevel, playerLevel);
            AdditionalMobSpawner.spawnEntity(orb, CustomEntityExperienceOrb.orbLoc(loc, 2));
          }
        }
      }

      this.die();

      for (i = 0; i < 20; i++) {
        double d0 = this.random.nextGaussian() * 0.02D;
        double d1 = this.random.nextGaussian() * 0.02D;
        double d2 = this.random.nextGaussian() * 0.02D;

        this.world.addParticle(
            EnumParticle.EXPLOSION_NORMAL,
            this.locX + this.random.nextFloat() * this.width * 2.0F - this.width,
            this.locY + this.random.nextFloat() * this.length,
            this.locZ + this.random.nextFloat() * this.width * 2.0F - this.width,
            d0,
            d1,
            d2,
            new int[0]);
      }
    }
  }