Skip to content

Commit

Permalink
Allow SongPlayer#preTick to cancel a tick
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Jan 2, 2025
1 parent 30214a6 commit 2bfaa2f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/net/raphimc/noteblocklib/player/SongPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ protected void createTickTask() {

protected void tick() {
try {
this.preTick();
if (!this.preTick()) {
return;
}
try {
if (this.paused) {
return;
Expand Down Expand Up @@ -148,7 +150,8 @@ protected void tick() {
}
}

protected void preTick() {
protected boolean preTick() {
return true;
}

protected abstract void playNotes(final List<Note> notes);
Expand Down

0 comments on commit 2bfaa2f

Please sign in to comment.