diff --git a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java index 2d8ca2faa..df3173f49 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java @@ -19,6 +19,7 @@ package org.maxgamer.quickshop.Shop; +import com.bekvon.bukkit.residence.commands.contract; import com.google.common.collect.Collections2; import com.google.common.collect.Lists; import com.google.gson.Gson; @@ -208,22 +209,40 @@ public interface DisplayItem { */ // type id such as 0, 1, 2, 3. List typeSections = - QuickShop.instance.getConfig().getList("shop.display-type-specifics"); + QuickShop.instance.getConfig().getList("shop.display-type-specifics", Lists.newArrayList()); + if (typeSections.isEmpty()) { + return DisplayType.fromID(QuickShop.instance.getConfig().getInt("shop.display-type")); + } for (Object typeSection : typeSections) { + if (typeSection == null) { + continue; + } // id as key Util.debugLog(typeSection.toString() + " @ LEVEL 1, " + typeSection.getClass().getName()); if (typeSection instanceof Map) { Map itemSections = Map.class.cast(typeSection); for (Entry itemSection : itemSections.entrySet()) { + if (itemSection == null) { + continue; + } // list Util.debugLog(itemSection.toString() + " @ LEVEL 2, " + itemSection.getClass().getName()); if (itemSection.getValue() instanceof List) { List infoSections = List.class.cast(itemSection.getValue()); + if (infoSections == null) { + continue; + } for (Object $infoSection : infoSections) { + if ($infoSection == null) { + continue; + } // custom name as key Util.debugLog($infoSection.toString() + " @ LEVEL 3, " + $infoSection.getClass().getName()); if ($infoSection instanceof Map) { for (Object infoSectiont : Map.class.cast($infoSection).values()) { + if (infoSectiont == null) { + continue; + } Map infoSection = Map.class.cast(infoSectiont); Util.debugLog(infoSection.toString() + " @ LEVEL 4, " + infoSection.getClass().getName()); List type = Lists.newArrayList(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 028548184..cbd4133ce 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -176,14 +176,24 @@ shop: #The display type you want use. #0=Normal Dropped Item, 1=ArmorStand display-type: 0 - + + # Custom display type depending on item meta display-type-specifics: - 0: - - 'test': - type: GLASS + - customType0: + type: AIR + lore: [] + strict: true + - customType1: + type: + - AIR_VOID + - AIR_CAVE - 1: - - 'test2': - type: GRASS + - demo: + type: AIR_VOID + lore: + - A demo item lore + - Another demo lore #Allow quickshop auto despawn-spawn the display when no-player or player close the shop. display-auto-despawn: false