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 33e7cf2..86b7f01 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/playing/SongHandler.java @@ -470,7 +470,7 @@ public class SongHandler { cleaningUp = false; SongPlayer.addChatMessage("§6Finished restoring original blocks"); if (!cleanupUnplaceableBlocks.isEmpty()) { - SongPlayer.addChatMessage(String.format("§3%d §6blocks were not successfully restored")); + SongPlayer.addChatMessage(String.format("§3%d §6blocks could not be restored", cleanupUnplaceableBlocks.size())); } } } @@ -504,6 +504,14 @@ public class SongHandler { } else if (!a_grav && b_grav) { return -1; } + // If there's gravity, sort by y coordinate + if (a_grav && b_grav) { + if (a.getY() < b.getY()) { + return -1; + } else if (a.getY() > b.getY()) { + return 1; + } + } // Then sort by distance int a_dx = a.getX() - lastStage.position.getX(); int a_dy = a.getY() - lastStage.position.getY(); @@ -541,6 +549,14 @@ public class SongHandler { } else if (!a_grav && b_grav) { return 1; } + // If there's gravity, sort by y coordinate + if (a_grav && b_grav) { + if (a.getY() < b.getY()) { + return 1; + } else if (a.getY() > b.getY()) { + return -1; + } + } // Then sort by distance int a_dx = a.getX() - lastStage.position.getX(); int a_dy = a.getY() - lastStage.position.getY();