fix: grow music inventory dynamically (#4583)

This commit is contained in:
Pierre Maurice Schwang 2025-01-26 12:51:54 +01:00 committed by GitHub
parent 11b806bd4d
commit 974c639a51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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