Fixed Panels size that could be higher than 54

This commit is contained in:
Florian CUNY 2018-09-01 17:38:36 +02:00
parent db3bf21c4c
commit d05582fd79

View File

@ -32,9 +32,11 @@ public class Panel implements HeadRequester {
}
// Create panel
if (size > 0) {
// Make sure size is a multiple of 9
// Make sure size is a multiple of 9 and is 54 max.
size = size + 8;
size -= (size % 9);
if (size > 54) size = 54;
inventory = Bukkit.createInventory(null, size, name);
// Fill the inventory and return
for (Map.Entry<Integer, PanelItem> en: items.entrySet()) {