Use pre-existing util method for item building

Removes util method added in previous commit.
This commit is contained in:
Keir Nellyer 2016-04-09 00:44:00 +01:00
parent 56b0a886bf
commit 51b5e50c20
No known key found for this signature in database
GPG Key ID: A2F398FC8175E3D9
2 changed files with 11 additions and 22 deletions

View File

@ -1025,21 +1025,6 @@ public class UtilItem
return list;
}
/**
* Helper method to set various commonly used meta-values.
*
* @param itemStack the stack to apply the changes to
* @param displayName the display name to set for the stack
* @param lore the lore to set for the stack
*/
public static void easyMeta(ItemStack itemStack, String displayName, String... lore)
{
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(displayName);
itemMeta.setLore(Arrays.asList(lore));
itemStack.setItemMeta(itemMeta);
}
public enum ItemCategory
{
EDIBLE,

View File

@ -8,8 +8,8 @@ import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilItem;
import mineplex.core.gui.SimpleGuiItem;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.report.ReportCategory;
/**
@ -21,13 +21,17 @@ public class ReportCategoryButton extends SimpleGuiItem
// initialize the display items we use
private static Map<ReportCategory, ItemStack> ITEM_STACKS = new EnumMap<ReportCategory, ItemStack>(ReportCategory.class)
{{
ItemStack hackItem = new ItemStack(Material.IRON_SWORD, 1);
UtilItem.easyMeta(hackItem, C.cRedB + "Hacking", C.cGray + "X-ray, Forcefield, Speed, Fly etc");
put(ReportCategory.HACKING, hackItem);
ItemStack itemHack = new ItemBuilder(Material.IRON_SWORD)
.setTitle(C.cRedB + "Hacking")
.addLore(C.cGray + "X-ray, Forcefield, Speed, Fly etc")
.build();
put(ReportCategory.HACKING, itemHack);
ItemStack chatAbuseItem = new ItemStack(Material.BOOK_AND_QUILL, 1);
UtilItem.easyMeta(chatAbuseItem, C.cDBlueB + "Chat Abuse", C.cGray + "Verbal Abuse, Spam, Harassment, Trolling, etc");
put(ReportCategory.CHAT_ABUSE, chatAbuseItem);
ItemStack itemChatAbuse = new ItemBuilder(Material.BOOK_AND_QUILL)
.setTitle(C.cDBlueB + "Chat Abuse")
.addLore(C.cGray + "Verbal Abuse, Spam, Harassment, Trolling, etc")
.build();
put(ReportCategory.CHAT_ABUSE, itemChatAbuse);
}};
private ReportCategoryPage _reportCategoryPage;