SteamWar/SpigotCore
Archiviert
13
0

SWItem can not be null
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
MoBrot 2022-07-12 22:08:00 +02:00
Ursprung 568d21a50d
Commit 50a58afa6a
2 geänderte Dateien mit 10 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -89,11 +89,17 @@ 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) {
if(material != null) {
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);
} }
}else {
itemStack = new ItemStack(Material.BARRIER, 1);
}
itemMeta = itemStack.getItemMeta(); itemMeta = itemStack.getItemMeta();
if (itemMeta != null) { if (itemMeta != null) {

Datei anzeigen

@ -235,10 +235,6 @@ public class SchematicSelector {
private SWListInv.SWListEntry<SchematicNode> renderItem(SchematicNode node) { private SWListInv.SWListEntry<SchematicNode> renderItem(SchematicNode node) {
Material m = SWItem.getMaterial(node.getItem()); Material m = SWItem.getMaterial(node.getItem());
if(m == null) {
m = Material.BARRIER;
}
String name = Core.MESSAGE.parse(filter.name == null?"SCHEM_SELECTOR_ITEM_NAME":"SCHEM_SELECTOR_ITEM_NAME_FILTER", player, node.getName()); String name = Core.MESSAGE.parse(filter.name == null?"SCHEM_SELECTOR_ITEM_NAME":"SCHEM_SELECTOR_ITEM_NAME_FILTER", player, node.getName());
if(filter.getName() != null) { if(filter.getName() != null) {