From 974c639a5167395ba4aff379bedcda34d69be006 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Sun, 26 Jan 2025 12:51:54 +0100 Subject: [PATCH] fix: grow music inventory dynamically (#4583) --- Core/src/main/java/com/plotsquared/core/command/Music.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Music.java b/Core/src/main/java/com/plotsquared/core/command/Music.java index dbdf9ac49..869e682d0 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Music.java +++ b/Core/src/main/java/com/plotsquared/core/command/Music.java @@ -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; @@ -94,7 +97,7 @@ public class Music extends SubCommand { PlotInventory inv = new PlotInventory( this.inventoryUtil, player, - 2, + INVENTORY_ROWS, TranslatableCaption.of("plotjukebox.jukebox_header").getComponent(player) ) { @Override