Skip to content

Commit

Permalink
check if mat is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanguygab committed Mar 26, 2021
1 parent 835af87 commit c70de4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c70de4b

Please sign in to comment.