From a156c5f885234c0b87869eac91b342f27d61137b Mon Sep 17 00:00:00 2001 From: aPunch Date: Sun, 5 Feb 2012 05:31:08 -0600 Subject: [PATCH] fixed bug --- src/net/citizensnpcs/npc/CitizensNPC.java | 2 +- src/net/citizensnpcs/trait/Inventory.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net/citizensnpcs/npc/CitizensNPC.java b/src/net/citizensnpcs/npc/CitizensNPC.java index 42826af65..03c57c551 100644 --- a/src/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/net/citizensnpcs/npc/CitizensNPC.java @@ -100,7 +100,7 @@ public abstract class CitizensNPC extends AbstractNPC { @Override public boolean openInventory(Player player) { - if (!isSpawned() || getTrait(Inventory.class).getContents() == null) + if (!isSpawned()) return false; getInventory().setContents(getTrait(Inventory.class).getContents()); inventory.show(player); diff --git a/src/net/citizensnpcs/trait/Inventory.java b/src/net/citizensnpcs/trait/Inventory.java index 57be6c3a7..cee309abb 100644 --- a/src/net/citizensnpcs/trait/Inventory.java +++ b/src/net/citizensnpcs/trait/Inventory.java @@ -17,6 +17,7 @@ public class Inventory implements Trait { private ItemStack[] contents; public Inventory() { + contents = new ItemStack[36]; } public Inventory(org.bukkit.inventory.Inventory inventory) {