Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ageable.java #27

Open
wants to merge 1 commit into
base: 1.20.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,7 @@ public int getForcedAgeTimer() {
* Increases this entity's age, optionally updating {@link #forcedAge}. If the entity is an adult (if the entity's
* age is greater than or equal to 0) then the entity's age will be set to {@link #forcedAge}.
*/
public void ageUp(int growthSeconds, boolean updateForcedAge) {
int growingAge = this.getGrowingAge();
int originalAge = growingAge;
growingAge += growthSeconds * 20;
if (growingAge > 0) {
growingAge = 0;
}

int ageAmount = growingAge - originalAge;
this.setGrowingAge(growingAge);
if (updateForcedAge) {
this.forcedAge += ageAmount;
if (this.forcedAgeTimer == 0) {
this.forcedAgeTimer = FORCED_AGE_TIME;
}
}

if (this.getGrowingAge() == 0) {
this.setGrowingAge(this.forcedAge);
}

}

/**
* Increases this entity's age. If the entity is an adult (if the entity's age is greater than or equal to 0) then
* the entity's age will be set to {@link #forcedAge}. This method does not update {@link #forcedAge}.
Expand Down Expand Up @@ -195,4 +173,4 @@ public boolean canSelfAge() {
&& this.getGrowingAge() < 0;
}
}
}
}