Changed block breaking criteria

This commit is contained in:
Harry Zhou 2022-07-03 20:51:15 -05:00
parent 420bd9502b
commit 50c661ae64
2 changed files with 10 additions and 2 deletions

View file

@ -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();

View file

@ -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;
}