Skip to content

Commit 974c639

Browse files
fix: grow music inventory dynamically (#4583)
1 parent 11b806b commit 974c639

File tree

1 file changed

+4
-1
lines changed
  • Core/src/main/java/com/plotsquared/core/command

1 file changed

+4
-1
lines changed

Core/src/main/java/com/plotsquared/core/command/Music.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public class Music extends SubCommand {
6060
"music_disc_creator_music_box", "music_disc_precipice"
6161
);
6262

63+
// make sure all discs and the bedrock ("cancel") fit into the inventory
64+
private static final int INVENTORY_ROWS = (int) Math.ceil((DISCS.size() + 1) / 9.0);
65+
6366
private final InventoryUtil inventoryUtil;
6467
private final EventDispatcher eventDispatcher;
6568

@@ -94,7 +97,7 @@ public boolean onCommand(PlotPlayer<?> player, String[] args) {
9497
PlotInventory inv = new PlotInventory(
9598
this.inventoryUtil,
9699
player,
97-
2,
100+
INVENTORY_ROWS,
98101
TranslatableCaption.of("plotjukebox.jukebox_header").getComponent(player)
99102
) {
100103
@Override

0 commit comments

Comments
 (0)