1
mirror of https://github.com/CarmJos/UserPrefix.git synced 2026-06-04 15:28:21 +08:00

优化代码

This commit is contained in:
carm
2021-09-08 19:10:22 +08:00
parent bd303f24b7
commit ee2cc259ef
@@ -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));