Skip to content

Commit

Permalink
Fixed items with custom names not working with 'gui.item-name' langua…
Browse files Browse the repository at this point in the history
…ge entry.
  • Loading branch information
BenWoodworth committed Apr 23, 2016
1 parent 201ed6a commit d617c09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ public String gui_title() {
}

public String gui_itemName(ItemStack item) {
return getNullable("gui.item-name", "name", BukkitUtil.getItemName(item));
String name = getNullable("gui.item-name", "name", BukkitUtil.getItemName(item));
return name != null ? name : item.getItemMeta().getDisplayName();
}

public List<String> gui_hashcode(FastRecipe recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public ItemStack getItem() {
Map<Ingredient, Integer> ingredients = recipe.getIngredients();

// Set the display name of the item
if (!meta.hasDisplayName()) {
meta.setDisplayName(lang.gui_itemName(item));
}
meta.setDisplayName(lang.gui_itemName(item));

// Add ingredients and amounts to the lore
lore.addFirst(lang.gui_ingredients_label());
Expand Down

0 comments on commit d617c09

Please sign in to comment.