From c70de4b97b3dd494164a31d2ec23e9c21b2996bd Mon Sep 17 00:00:00 2001 From: Tanguygab Date: Fri, 26 Mar 2021 18:51:26 +0100 Subject: [PATCH] check if mat is null --- .../tabadditions/shared/features/UnlimitedItemLines.java | 2 +- .../io/github/tanguygab/tabadditions/spigot/BukkitItemLine.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/tanguygab/tabadditions/shared/features/UnlimitedItemLines.java b/src/main/java/io/github/tanguygab/tabadditions/shared/features/UnlimitedItemLines.java index a7b14b7..90a2071 100644 --- a/src/main/java/io/github/tanguygab/tabadditions/shared/features/UnlimitedItemLines.java +++ b/src/main/java/io/github/tanguygab/tabadditions/shared/features/UnlimitedItemLines.java @@ -69,12 +69,12 @@ public void onWorldChange(TabPlayer p, String from, String to) { public BukkitItemLine createItemLine(TabPlayer p, ArmorStand as) { Property prop = as.getProperty(); prop.changeRawValue(prop.getOriginalRawValue().replace("ITEM:","")); + boolean glow = false; if (prop.getFormat(p).contains(",glow")) { glow = true; prop.changeRawValue(prop.getOriginalRawValue().replace(",glow","")); } - if (Material.getMaterial(prop.getFormat(p)) == null) return null; return new BukkitItemLine(as.getEntityId(),p,prop,as.getOffset(),as.hasStaticOffset(),glow); } diff --git a/src/main/java/io/github/tanguygab/tabadditions/spigot/BukkitItemLine.java b/src/main/java/io/github/tanguygab/tabadditions/spigot/BukkitItemLine.java index 9735e1a..7a8de7b 100644 --- a/src/main/java/io/github/tanguygab/tabadditions/spigot/BukkitItemLine.java +++ b/src/main/java/io/github/tanguygab/tabadditions/spigot/BukkitItemLine.java @@ -33,6 +33,7 @@ public BukkitItemLine(int entityId, TabPlayer owner, Property property, double y @Override public Object[] getSpawnPackets(TabPlayer viewer) { Material mat = Material.getMaterial(prop.getFormat(viewer)); + if (mat == null) mat = Material.AIR; ItemStack itemStack = new ItemStack(mat); Player p = (Player) viewer.getPlayer(); if (glow)