From ee2cc259ef836fdc15c6600903b84b565c0eb55b Mon Sep 17 00:00:00 2001 From: carm Date: Wed, 8 Sep 2021 19:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/carm/plugin/userprefix/util/gui/GUI.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/main/java/cc/carm/plugin/userprefix/util/gui/GUI.java b/src/main/java/cc/carm/plugin/userprefix/util/gui/GUI.java index 7f1ddfd..4274c54 100644 --- a/src/main/java/cc/carm/plugin/userprefix/util/gui/GUI.java +++ b/src/main/java/cc/carm/plugin/userprefix/util/gui/GUI.java @@ -55,11 +55,11 @@ public class GUI { case FIVEBYNINE: this.items = new GUIItem[45]; break; - default: case SIXBYNINE: this.items = new GUIItem[54]; break; case CANCEL: + default: this.items = null; } } @@ -167,18 +167,8 @@ public class GUI { if (this.type == GUIType.CANCEL) { throw new NullPointerException("被取消或不存在的GUI"); } - switch (type) { - default: - case ONEBYNINE: - case TWOBYNINE: - case THREEBYNINE: - case FOURBYNINE: - case FIVEBYNINE: - case SIXBYNINE: - inv = Bukkit.createInventory(null, this.items.length, this.name); - break; - } - + inv = Bukkit.createInventory(null, this.items.length, this.name); + for (int index = 0; index < this.items.length; index++) { if (items[index] == null) { inv.setItem(index, new ItemStack(Material.AIR));