mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-08 11:41:10 +00:00
Add IS_BANNER_PATTERN for hologram format
This commit is contained in:
parent
03792981eb
commit
bac5a24b37
@ -18,8 +18,8 @@ public class HologramFormat {
|
||||
|
||||
public enum Requirement {
|
||||
VENDOR, AMOUNT, ITEM_TYPE, ITEM_NAME, HAS_ENCHANTMENT, BUY_PRICE,
|
||||
SELL_PRICE, HAS_POTION_EFFECT, IS_MUSIC_DISC, IS_POTION_EXTENDED, IS_WRITTEN_BOOK, ADMIN_SHOP,
|
||||
NORMAL_SHOP, IN_STOCK, MAX_STACK, CHEST_SPACE, DURABILITY
|
||||
SELL_PRICE, HAS_POTION_EFFECT, IS_MUSIC_DISC, IS_POTION_EXTENDED, IS_BANNER_PATTERN,
|
||||
IS_WRITTEN_BOOK, ADMIN_SHOP, NORMAL_SHOP, IN_STOCK, MAX_STACK, CHEST_SPACE, DURABILITY
|
||||
}
|
||||
|
||||
// no "-" sign since no variable can be negative
|
||||
|
@ -270,6 +270,7 @@ public class Shop {
|
||||
requirements.put(HologramFormat.Requirement.IS_MUSIC_DISC, itemStack.getType().isRecord());
|
||||
requirements.put(HologramFormat.Requirement.IS_POTION_EXTENDED, ItemUtils.isExtendedPotion(itemStack));
|
||||
requirements.put(HologramFormat.Requirement.IS_WRITTEN_BOOK, itemStack.getType() == Material.WRITTEN_BOOK);
|
||||
requirements.put(HologramFormat.Requirement.IS_BANNER_PATTERN, ItemUtils.isBannerPattern(itemStack));
|
||||
requirements.put(HologramFormat.Requirement.ADMIN_SHOP, getShopType() == ShopType.ADMIN);
|
||||
requirements.put(HologramFormat.Requirement.NORMAL_SHOP, getShopType() == ShopType.NORMAL);
|
||||
requirements.put(HologramFormat.Requirement.IN_STOCK, Utils.getAmount(inventory, itemStack));
|
||||
|
@ -45,6 +45,10 @@ public class ItemUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isBannerPattern(ItemStack itemStack) {
|
||||
return itemStack.getType().name().endsWith("BANNER_PATTERN");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@link ItemStack} from a String
|
||||
* @param item Serialized ItemStack e.g. {@code "STONE"} or {@code "STONE:1"}
|
||||
|
@ -5,8 +5,8 @@
|
||||
# Valid requirements are:
|
||||
# VENDOR, AMOUNT, ITEM_TYPE, ITEM_NAME, HAS_ENCHANTMENT, BUY_PRICE,
|
||||
# SELL_PRICE, HAS_POTION_EFFECT, IS_MUSIC_DISC, IS_POTION_EXTENDED,
|
||||
# IS_WRITTEN_BOOK, ADMIN_SHOP, NORMAL_SHOP, IN_STOCK, MAX_STACK,
|
||||
# CHEST_SPACE, DURABILITY
|
||||
# IS_WRITTEN_BOOK, IS_BANNER_PATTERN, ADMIN_SHOP, NORMAL_SHOP,
|
||||
# IN_STOCK, MAX_STACK, CHEST_SPACE, DURABILITY
|
||||
#
|
||||
# You can also use the requirements for conditions.
|
||||
# ITEM_TYPE will return the type of the item (-> item_names.txt),
|
||||
|
Loading…
Reference in New Issue
Block a user