mirror of
https://github.com/songoda/EpicVouchers.git
synced 2024-11-22 10:05:15 +01:00
Hotfix /ev editor not working with too many vouchers
It is not able to show all Vouchers if the limit is exceeded but at least it opens the inventory for now
This commit is contained in:
parent
d7801dd64f
commit
a53dab9e18
@ -16,7 +16,12 @@ import static org.bukkit.Material.PAPER;
|
||||
|
||||
public class VoucherMenu extends IconInv {
|
||||
public VoucherMenu(EpicVouchers instance) {
|
||||
super((int) (Math.ceil(instance.getVoucherManager().getVouchers().size() / 9.0) * 9 + (instance.getVoucherManager().getVouchers().size() % 9 == 0 ? 9 : 0)), "Vouchers");
|
||||
// FIXME: Having too many vouchers throws an error:
|
||||
// Size for custom inventory must be a multiple of 9 between 9 and 54 slots (got 594)
|
||||
// Applied hotfix to use a maximum size of 54
|
||||
// Example file: https://support.songoda.com/secure/attachment/17258/17258_vouchers.yml
|
||||
|
||||
super(Math.min((int) (Math.ceil(instance.getVoucherManager().getVouchers().size() / 9.0) * 9 + (instance.getVoucherManager().getVouchers().size() % 9 == 0 ? 9 : 0)), 54), "Vouchers");
|
||||
|
||||
for (Voucher voucher : instance.getVoucherManager().getVouchers()) {
|
||||
if (getInventory().firstEmpty() != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user