From 49d6930389d5aa8eb7040926a92f9d6ebf3b9e36 Mon Sep 17 00:00:00 2001 From: filoghost Date: Mon, 20 Aug 2018 17:00:33 +0200 Subject: [PATCH] Fix console error on invalid icon --- .../holographicdisplays/nms/v1_11_R1/EntityNMSItem.java | 4 ++-- .../holographicdisplays/nms/v1_12_R1/EntityNMSItem.java | 4 ++-- .../holographicdisplays/nms/v1_13_R1/EntityNMSItem.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NMS/v1_11_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java b/NMS/v1_11_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java index 1eab5c02..6261e8f5 100644 --- a/NMS/v1_11_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java +++ b/NMS/v1_11_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java @@ -166,9 +166,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { - ItemStack newItem = CraftItemStack.asNMSCopy(stack); + ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is null, invalid or the material is not an Item - if (newItem == null) { + if (newItem == null || newItem == ItemStack.a) { newItem = new ItemStack(Blocks.BEDROCK); } diff --git a/NMS/v1_12_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java b/NMS/v1_12_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java index 2a11431d..2516a8c9 100644 --- a/NMS/v1_12_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java +++ b/NMS/v1_12_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java @@ -166,9 +166,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { - ItemStack newItem = CraftItemStack.asNMSCopy(stack); + ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is null, invalid or the material is not an Item - if (newItem == null) { + if (newItem == null || newItem == ItemStack.a) { newItem = new ItemStack(Blocks.BEDROCK); } diff --git a/NMS/v1_13_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java b/NMS/v1_13_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java index f3b2106a..7e7aab3a 100644 --- a/NMS/v1_13_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java +++ b/NMS/v1_13_R1/src/main/java/com/gmail/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java @@ -166,9 +166,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { - ItemStack newItem = CraftItemStack.asNMSCopy(stack); + ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is null, invalid or the material is not an Item - if (newItem == null) { + if (newItem == null || newItem == ItemStack.a) { newItem = new ItemStack(Blocks.BEDROCK); }