Skip to content

Commit

Permalink
added growing health
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Mar 23, 2021
1 parent c27b956 commit ac99b6d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/net/adventurez/entity/DragonEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ public void tick() {
}
if (this.dragonAge == 5 && this.getSize() == 1) {
this.setSize(2);
this.healDragonIfGrowing();
}
if (this.dragonAge == 15 && this.getSize() == 2) {
this.setSize(3);
this.healDragonIfGrowing();
}
if (this.dragonAgeFoodBonus > 5) {
this.dragonAgeFoodBonus = 0;
Expand All @@ -593,6 +595,12 @@ public void tick() {
}
}

private void healDragonIfGrowing() {
if (this.getHealth() < this.getMaxHealth()) {
this.setHealth(this.getHealth() + 20F);
}
}

@Override
public boolean isPushable() {
return !this.hasPassengers();
Expand Down

0 comments on commit ac99b6d

Please sign in to comment.