Skip to content

Commit

Permalink
fix: final tutorial stage constantly triggering after it has already …
Browse files Browse the repository at this point in the history
…been finished
  • Loading branch information
Jamalam360 committed Jun 21, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents ea3632c + fe7e678 commit b72fb12
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Changelog

Port to 1.20/1.20.1.
- Fix final tutorial stage constantly triggering after it has already been finished.
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true

# Name of your built jar
archive_base_name=tutorial-lib
mod_version=1.1.0+1.20.x
release_name=V1.1.0 [1.20.x]
mod_version=1.1.1+1.20.x
release_name=V1.1.1 [1.20.x]
supported_versions=1.20,1.20.1

# Used for releasing GitHub releases
github_user=JamCoreModding
github_repo=tutorial-lib
release_branch=main
14 changes: 5 additions & 9 deletions src/main/java/io/github/jamalam360/tutorial/lib/Tutorial.java
Original file line number Diff line number Diff line change
@@ -62,18 +62,14 @@ public void setCurrentStageIndex(int index) {
this.stage = index;
}

public boolean advanceStage() {
if (this.getCurrentStageIndex() + 1 >= this.stages.length) {
this.getCurrentStage().onFinish(this.getTutorialManager());
this.setCurrentStageIndex(this.getCurrentStageIndex() + 1);
return false;
}

public void advanceStage() {
this.getCurrentStage().onFinish(this.getTutorialManager());
this.setCurrentStageIndex(this.getCurrentStageIndex() + 1);
this.saveGameOptions();
this.getCurrentStage().onStart(this.getTutorialManager());
return true;

if (this.getCurrentStageIndex() < this.stages.length) {
this.getCurrentStage().onStart(this.getTutorialManager());
}
}

public void setStageProgress(float progress) {

0 comments on commit b72fb12

Please sign in to comment.