Skip to content

Commit

Permalink
Don't re-register backpacks (=> crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
copygirl committed Jan 24, 2014
1 parent a65de71 commit 805c160
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ public ItemArmorBetterStorage(int id, EnumArmorMaterial material, int renderSlot
setCreativeTab(BetterStorage.creativeTab);

setUnlocalizedName(Constants.modId + "." + getItemName());
GameRegistry.registerItem(this, getItemName());
if (!isItemBlock()) GameRegistry.registerItem(this, getItemName());

}

public boolean isItemBlock() { return false; }

/** Returns the name of this item, for example "drinkingHelmet". */
public String getItemName() {
return ((name != null) ? name : (name = MiscUtils.getName(this)));
Expand Down
3 changes: 3 additions & 0 deletions src/net/mcft/copy/betterstorage/item/ItemBackpack.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ protected ItemBackpack(int id, EnumArmorMaterial material) {
}
public ItemBackpack(int id) { this(id, material); }

@Override
public boolean isItemBlock() { return true; }

public String getBackpackName() { return Constants.containerBackpack; }

/** Returns the number of columns this backpack has. */
Expand Down

0 comments on commit 805c160

Please sign in to comment.