コード例 #1
0
ファイル: Sheep.java プロジェクト: speaw/OpenClassic
  public void hurt(Entity cause, int damage) {
    if (this.hasFur && cause instanceof Player) {
      this.hasFur = false;
      int wool = (int) (Math.random() * 3.0D + 1.0D);

      for (int count = 0; count < wool; ++count) {
        this.level.addEntity(
            new Item(this.level, this.x, this.y, this.z, VanillaBlock.WHITE_CLOTH.getId()));
      }

    } else {
      super.hurt(cause, damage);
    }
  }