SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'SchematicSelectorItemFix' (#203) from SchematicSelectorItemFix into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #203
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-07-21 12:45:14 +02:00
Commit da60ab92ee

Datei anzeigen

@ -51,7 +51,11 @@ public class SWItem {
public static Material getMaterial(String material){ public static Material getMaterial(String material){
try{ try{
return FlatteningWrapper.impl.getMaterial(material); Material m = FlatteningWrapper.impl.getMaterial(material);
if(m == null)
return Material.BARRIER;
return m;
}catch(IllegalArgumentException e){ }catch(IllegalArgumentException e){
return Material.STONE; return Material.STONE;
} }
@ -89,11 +93,13 @@ public class SWItem {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public SWItem(Material material, byte meta, String name, List<String> lore, boolean enchanted, InvCallback c) { public SWItem(Material material, byte meta, String name, List<String> lore, boolean enchanted, InvCallback c) {
try { try {
itemStack = new ItemStack(material, 1, (short)0, meta); itemStack = new ItemStack(material, 1, (short)0, meta);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
itemStack = new ItemStack(material, 1); itemStack = new ItemStack(material, 1);
} }
itemMeta = itemStack.getItemMeta(); itemMeta = itemStack.getItemMeta();
if (itemMeta != null) { if (itemMeta != null) {