Fix console error on invalid icon

This commit is contained in:
filoghost 2018-08-20 17:00:33 +02:00
parent 95d2a26f4f
commit 49d6930389
3 changed files with 6 additions and 6 deletions

View File

@ -166,9 +166,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { 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); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -166,9 +166,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { 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); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -166,9 +166,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { 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); newItem = new ItemStack(Blocks.BEDROCK);
} }