add bind tag to Misc.java...

Signed-off-by: j502647092 <jtb1@163.com>
pull/1/MERGE
j502647092 2015-04-29 15:01:54 +08:00
parent 3b72815e63
commit d4e26f4fcd
2 changed files with 11 additions and 11 deletions

View File

@ -75,7 +75,7 @@ public class ItemUtils {
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
itemLore.addAll(itemMeta.getLore()); itemLore.addAll(itemMeta.getLore());
} }
itemLore.add(ChatColor.DARK_RED + "Bind on Pickup"); itemLore.add(Misc.PICKUPBIND_TAG);
itemMeta.setLore(itemLore); itemMeta.setLore(itemLore);
itemStack.setItemMeta(itemMeta); itemStack.setItemMeta(itemMeta);
return itemStack; return itemStack;
@ -96,7 +96,7 @@ public class ItemUtils {
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
itemLore.addAll(itemMeta.getLore()); itemLore.addAll(itemMeta.getLore());
} }
itemLore.add(ChatColor.DARK_RED + "Bind on Equip"); itemLore.add(Misc.EQUIPBIND_TAG);
itemMeta.setLore(itemLore); itemMeta.setLore(itemLore);
itemStack.setItemMeta(itemMeta); itemStack.setItemMeta(itemMeta);
return itemStack; return itemStack;
@ -117,7 +117,7 @@ public class ItemUtils {
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
itemLore.addAll(itemMeta.getLore()); itemLore.addAll(itemMeta.getLore());
} }
itemLore.add(ChatColor.DARK_RED + "Bind on Use"); itemLore.add(Misc.USEBIND_TAG);
itemMeta.setLore(itemLore); itemMeta.setLore(itemLore);
itemStack.setItemMeta(itemMeta); itemStack.setItemMeta(itemMeta);
return itemStack; return itemStack;
@ -167,7 +167,7 @@ public class ItemUtils {
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
List<String> itemLore = itemMeta.getLore(); List<String> itemLore = itemMeta.getLore();
for (String lore : itemLore) { for (String lore : itemLore) {
if (lore.equalsIgnoreCase(Misc.SOULBOUND_TAG)) { if (lore.contains(Misc.SOULBOUND_TAG)) {
return true; return true;
} }
} }
@ -183,7 +183,7 @@ public class ItemUtils {
ItemMeta itemMeta = itemStack.getItemMeta(); ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
List<String> itemLore = itemMeta.getLore(); List<String> itemLore = itemMeta.getLore();
if (itemLore.contains(ChatColor.DARK_RED + "Bind on Pickup")) { if (itemLore.contains(Misc.PICKUPBIND_TAG)) {
return true; return true;
} }
} }
@ -198,7 +198,7 @@ public class ItemUtils {
ItemMeta itemMeta = itemStack.getItemMeta(); ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
List<String> itemLore = itemMeta.getLore(); List<String> itemLore = itemMeta.getLore();
if (itemLore.contains(ChatColor.DARK_RED + "Bind on Use")) { if (itemLore.contains(Misc.USEBIND_TAG)) {
return true; return true;
} }
} }
@ -213,7 +213,7 @@ public class ItemUtils {
ItemMeta itemMeta = itemStack.getItemMeta(); ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta.hasLore()) { if (itemMeta.hasLore()) {
List<String> itemLore = itemMeta.getLore(); List<String> itemLore = itemMeta.getLore();
if (itemLore.contains(ChatColor.DARK_RED + "Bind on Equip")) { if (itemLore.contains(Misc.EQUIPBIND_TAG)) {
return true; return true;
} }
} }

View File

@ -3,8 +3,8 @@ package com.me.tft_02.soulbound.util;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
public class Misc { public class Misc {
public static String SOULBOUND_TAG = ChatColor.GOLD + "Soulbound"; public static String SOULBOUND_TAG = ChatColor.GOLD + "灵魂绑定";
public static String PICKUPBIND_TAG = ChatColor.GOLD + "Soulbound"; public static String PICKUPBIND_TAG = ChatColor.DARK_RED + "拾取后绑定";
public static String USEBIND_TAG = ChatColor.GOLD + "Soulbound"; public static String USEBIND_TAG = ChatColor.DARK_RED + "使用后绑定";
public static String EQUIPBIND_TAG = ChatColor.GOLD + "Soulbound"; public static String EQUIPBIND_TAG = ChatColor.DARK_RED + "装备后绑定";
} }