示例#1
0
  public void die(DamageSource damagesource) {
    Entity entity = damagesource.getEntity();
    EntityLiving entityliving = this.aX();

    if (this.bb >= 0 && entityliving != null) {
      entityliving.b(this, this.bb);
    }

    if (entity != null) {
      entity.a(this);
    }

    this.aU = true;
    if (!this.world.isStatic) {
      int i = 0;

      if (entity instanceof EntityHuman) {
        i = EnchantmentManager.getBonusMonsterLootEnchantmentLevel((EntityLiving) entity);
      }

      if (this.aG() && this.world.getGameRules().getBoolean("doMobLoot")) {
        this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i);
        this.dropEquipment(this.lastDamageByPlayerTime > 0, i);
        if (this.lastDamageByPlayerTime > 0) {
          int j = this.random.nextInt(200) - i;

          if (j < 5) {
            this.getRareDrop(j <= 0 ? 1 : 0);
          }
        }
      }
    }

    this.world.broadcastEntityEffect(this, (byte) 3);
  }
示例#2
0
  public void die(DamageSource damagesource) {
    Entity entity = damagesource.getEntity();
    EntityLiving entityliving = this.aS();

    if (this.bb >= 0 && entityliving != null) {
      entityliving.b(this, this.bb);
    }

    if (entity != null) {
      entity.a(this);
    }

    this.aU = true;
    if (!this.world.isStatic) {
      int i = 0;

      if (entity instanceof EntityHuman) {
        i = EnchantmentManager.getBonusMonsterLootEnchantmentLevel((EntityLiving) entity);
      }

      if (!this.isBaby() && this.world.getGameRules().getBoolean("doMobLoot")) {
        this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i);
        this.dropEquipment(this.lastDamageByPlayerTime > 0, i);
        if (false
            && this.lastDamageByPlayerTime
                > 0) { // CraftBukkit - move rare item drop call to dropDeathLoot
          int j = this.random.nextInt(200) - i;

          if (j < 5) {
            this.l(j <= 0 ? 1 : 0);
          }
        }
      } else { // CraftBukkit
        CraftEventFactory.callEntityDeathEvent(this); // CraftBukkit
      }
    }

    this.world.broadcastEntityEffect(this, (byte) 3);
  }