Stop block breaking action after hits

This commit is contained in:
Harry Zhou 2022-07-01 20:41:04 -05:00
parent ef1c5715b2
commit 0544801837

View file

@ -221,14 +221,19 @@ public class SongHandler {
currentSong.play();
boolean somethingPlayed = false;
currentSong.advanceTime();
while (currentSong.reachedNextNote()) {
Note note = currentSong.getNextNote();
BlockPos bp = stage.noteblockPositions.get(note.noteId);
if (bp != null) {
attackBlock(bp);
somethingPlayed = true;
}
}
if (somethingPlayed) {
stopAttack();
}
if (currentSong.finished()) {
currentSong = null;
@ -315,4 +320,7 @@ public class SongHandler {
private void attackBlock(BlockPos bp) {
SongPlayer.MC.interactionManager.attackBlock(bp, Direction.UP);
}
private void stopAttack() {
SongPlayer.MC.interactionManager.cancelBlockBreaking();
}
}