13
0

Fix Illegal argument exception

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-01-01 09:47:18 +01:00
Ursprung 93e1e13a8d
Commit 4bf1905496

Datei anzeigen

@ -207,8 +207,13 @@ class GUI {
Material m; Material m;
if (schem.getItem().isEmpty()) if (schem.getItem().isEmpty())
m = SWItem.getMaterial("CAULDRON_ITEM"); m = SWItem.getMaterial("CAULDRON_ITEM");
else else{
try{
m = SWItem.getMaterial(schem.getItem()); m = SWItem.getMaterial(schem.getItem());
}catch(IllegalArgumentException e){
m = SWItem.getMaterial("CAULDRON_ITEM");
}
}
SWItem item = new SWItem(m, "§e" + schem.getSchemName(), Collections.singletonList("§7" + schem.getSchemType().name()), !schem.getSchemType().writeable(), click -> {}); SWItem item = new SWItem(m, "§e" + schem.getSchemName(), Collections.singletonList("§7" + schem.getSchemType().name()), !schem.getSchemType().writeable(), click -> {});
if(schem.getRank() > 0) if(schem.getRank() > 0)