mirror of
https://github.com/CarmJos/UserPrefix.git
synced 2026-06-04 23:43:29 +08:00
优化代码
This commit is contained in:
@@ -55,11 +55,11 @@ public class GUI {
|
|||||||
case FIVEBYNINE:
|
case FIVEBYNINE:
|
||||||
this.items = new GUIItem[45];
|
this.items = new GUIItem[45];
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
case SIXBYNINE:
|
case SIXBYNINE:
|
||||||
this.items = new GUIItem[54];
|
this.items = new GUIItem[54];
|
||||||
break;
|
break;
|
||||||
case CANCEL:
|
case CANCEL:
|
||||||
|
default:
|
||||||
this.items = null;
|
this.items = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,17 +167,7 @@ public class GUI {
|
|||||||
if (this.type == GUIType.CANCEL) {
|
if (this.type == GUIType.CANCEL) {
|
||||||
throw new NullPointerException("被取消或不存在的GUI");
|
throw new NullPointerException("被取消或不存在的GUI");
|
||||||
}
|
}
|
||||||
switch (type) {
|
inv = Bukkit.createInventory(null, this.items.length, this.name);
|
||||||
default:
|
|
||||||
case ONEBYNINE:
|
|
||||||
case TWOBYNINE:
|
|
||||||
case THREEBYNINE:
|
|
||||||
case FOURBYNINE:
|
|
||||||
case FIVEBYNINE:
|
|
||||||
case SIXBYNINE:
|
|
||||||
inv = Bukkit.createInventory(null, this.items.length, this.name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int index = 0; index < this.items.length; index++) {
|
for (int index = 0; index < this.items.length; index++) {
|
||||||
if (items[index] == null) {
|
if (items[index] == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user