Stop block breaking action after hits
This commit is contained in:
parent
ef1c5715b2
commit
0544801837
1 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue