mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2024-11-18 01:18:54 +00:00
add lose file...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
parent
bc5e6a6c0b
commit
500e94cb29
23
src/main/java/org/maxgamer/QuickShop/Util/MarkUtil.java
Normal file
23
src/main/java/org/maxgamer/QuickShop/Util/MarkUtil.java
Normal file
@ -0,0 +1,23 @@
|
||||
package org.maxgamer.QuickShop.Util;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
public class MarkUtil {
|
||||
static String mark = "§q§s§r";
|
||||
|
||||
public static void addMark(final ItemStack ci) {
|
||||
final ItemMeta meta = ci.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "QuickShop " + Util.getName(ci));
|
||||
ci.setItemMeta(meta);
|
||||
}
|
||||
|
||||
public static boolean hasMark(final ItemStack ci) {
|
||||
try {
|
||||
return ci.getItemMeta().getDisplayName().startsWith(mark);
|
||||
} catch (final Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user