From 50c661ae642114dc42bb4b0d083b6e4185ebff7d Mon Sep 17 00:00:00 2001 From: Harry Zhou Date: Sun, 3 Jul 2022 20:51:15 -0500 Subject: [PATCH] Changed block breaking criteria --- .../hhhzzzsss/songplayer/playing/SongHandler.java | 2 +- .../com/github/hhhzzzsss/songplayer/playing/Stage.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java index 4836f62..139bfd0 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java @@ -202,7 +202,7 @@ public class SongHandler { if (stage.hasBreakingModification()) { stage.checkBuildStatus(currentSong); } - if (!stage.missingNotes.isEmpty()) { + if (!stage.nothingToBuild()) { building = true; setCreativeIfNeeded(); stage.movePlayerToStagePosition(); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java b/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java index a6964ba..958ef07 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/playing/Stage.java @@ -153,7 +153,10 @@ public class Stage { requiredBreaks = breakLocations .stream() - .filter((bp) -> Block.getRawIdFromState(SongPlayer.MC.world.getBlockState(bp)) != 0) + .filter((bp) -> { + BlockState bs = SongPlayer.MC.world.getBlockState(bp); + return !bs.isAir() && !bs.getMaterial().isLiquid(); + }) .sorted((a, b) -> { // First sort by y if (a.getY() < b.getY()) { @@ -223,6 +226,11 @@ public class Stage { return true; } } + + BlockState aboveBs = SongPlayer.MC.world.getBlockState(entry.getValue().up()); + if (!aboveBs.isAir() && !aboveBs.getMaterial().isLiquid()) { + return true; + } } return false; }