GUI overflow fix.

This commit is contained in:
Brianna 2019-04-19 22:03:01 -04:00
parent 988e75dcb5
commit 25ff13a58f
2 changed files with 10 additions and 8 deletions

View File

@ -74,7 +74,7 @@ public class GUIDisplayKit extends AbstractGUI {
max = 54 - min;
if (amt <= 7) {
max = 27 - min;
} else if (amt <= 16) {
} else if (amt <= 15) {
max = 36 - min;
} else if (amt <= 23) {
max = 45 - min;
@ -152,11 +152,10 @@ public class GUIDisplayKit extends AbstractGUI {
for (ItemStack is : list) {
if (!plugin.getConfig().getBoolean("Interfaces.Do Not Use Glass Borders")) {
if (num == 17)
num++;
if (num == (max - 18))
num++;
if (num == 17 || num == (max - 18)) num++;
if (num == 18 && max == 36) num++;
}
System.out.println("hit " + num);
ItemMeta meta = is.hasItemMeta() ? is.getItemMeta() : Bukkit.getItemFactory().getItemMeta(is.getType());
ArrayDeque<String> lore;

View File

@ -50,9 +50,9 @@ public class GUIKitSelector extends AbstractGUI {
if (glassless) {
if (kitList.size() > n + 34)
max = max + 34;
else if (kitList.size() > n + 25)
else if (kitList.size() > n + 23)
max = max + 25;
else if (kitList.size() > n + 16)
else if (kitList.size() > n + 14)
max = max + 16;
else if (kitList.size() > n + 7)
max = max + 7;
@ -129,7 +129,10 @@ public class GUIKitSelector extends AbstractGUI {
if (!glassless)
tmax = tmax - 10;
for (int index = num; index != tmax; index++) {
if (!glassless && index == 17) index = 19;
if (!glassless) {
if (num == 17 || num == (max - 18)) num++;
if (num == 18 && max == 36) num++;
}
if (id > kitList.size() - 1) {
inventory.setItem(index, new ItemStack(Material.AIR));
continue;