Skip to content

Commit

Permalink
fix: grow music inventory dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreSchwang committed Jan 25, 2025
1 parent 11b806b commit f48fc55
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Core/src/main/java/com/plotsquared/core/command/Music.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class Music extends SubCommand {
"music_disc_creator_music_box", "music_disc_precipice"
);

// make sure all discs and the bedrock ("cancel") fit into the inventory
private static final int INVENTORY_ROWS = (int) Math.ceil((DISCS.size() + 1) / 9.0);

private final InventoryUtil inventoryUtil;
private final EventDispatcher eventDispatcher;

Expand Down Expand Up @@ -94,7 +97,7 @@ public boolean onCommand(PlotPlayer<?> player, String[] args) {
PlotInventory inv = new PlotInventory(
this.inventoryUtil,
player,
2,
INVENTORY_ROWS,
TranslatableCaption.of("plotjukebox.jukebox_header").getComponent(player)
) {
@Override
Expand Down

0 comments on commit f48fc55

Please sign in to comment.