diff --git a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java index 0f7cdbf11..75fe8a7d1 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java @@ -242,7 +242,10 @@ public class MsgUtil { p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+"); p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.shop-information")); p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.owner", shop.ownerName())); - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.item", MsgUtil.getItemi18n(shop.getDataName()))); + //p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.item", MsgUtil.getItemi18n(shop.getDataName()))); + //Enabled + Util.sendItemholochat(shop.getItem(),p,ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.item", MsgUtil.getItemi18n(shop.getDataName())), MsgUtil.getMessage("menu.hold-to-view")); + // if (NMS.isPotion(items.getType())) { // String effects = CustomPotionsName.getEffects(items); // if (!effects.isEmpty()) { diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index be4e44db1..e484917c4 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -620,13 +620,12 @@ public class Util { } } - @SuppressWarnings("null") - public void sendItemholochat(ItemStack itemStack, Player player, String normalText, String actionText) { + public static void sendItemholochat(ItemStack itemStack, Player player, String normalText, String actionText) { String Itemname = null; - List Itemlore = null; + List Itemlore = new ArrayList<>(); String finalItemdata = null; - Map enchs = null; - Map Itemenchs = null; + Map enchs = new HashMap(); + Map Itemenchs = new HashMap(); if (itemStack.hasItemMeta()) { ItemMeta iMeta = itemStack.getItemMeta(); if (iMeta.hasDisplayName()) { diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml index 352460313..6e2381bf5 100644 --- a/src/main/resources/messages.yml +++ b/src/main/resources/messages.yml @@ -1,108 +1,110 @@ -# Colors: -# &0-9, &a-f -# {0}, {1}, {2}, etc are variables. You can swap them around, but adding a new variable won't work. Removing them will work - -not-looking-at-shop: "&cNo QuickShop found. You must be looking at one." -no-permission: "&cYou do not have permission to do that." -no-creative-break: "&cYou cannot break other players shops in creative mode. Use survival instead." -no-double-chests: "&cYou don't have permission to create a double-chest shop." -shop-already-owned: "&cThat is already a shop." -chest-was-removed: "&cThat chest was removed." -price-too-cheap: "&cPrice must be greater than &e$0.01" -no-price-change: "&cThat wouldn't result in a price change!" -you-cant-afford-a-new-shop: "&cIt costs {0} to create a new shop." -player-bought-from-your-store-tax: "&c{0} purchased {1} {2} from your store, and you paid {3} in taxes." -you-cant-afford-to-change-price: "&cIt costs {0} to change the price in your shop." -success-created-shop: "&aCreated shop." -success-removed-shop: "&aShop removed." -shops-arent-locked: "&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!" -shop-creation-cancelled: "&cCancelled Shop Creation." -shop-purchase-cancelled: "&cCancelled Shop Purchase." -shop-stock-too-low: "&cThe shop only has {0} {1} left" -you-cant-afford-to-buy: "&cThat costs {0}, but you only have {1}" -negative-amount: "&cDerp, can't trade negative amounts" -player-bought-from-your-store: "&c{0} purchased {1} {2} from your store." -shop-out-of-stock: "&5Your shop at {0}, {1}, {2}, has run out of {3}" -shop-has-no-space: "&cThe shop only has room for {0} more {1}." -you-dont-have-that-many-items: "&cYou only have {0} {1}." -the-owner-cant-afford-to-buy-from-you: "&cThat costs {0} but the owner only has {1}" -player-sold-to-your-store: "&a{0} sold {1} {2} to your store." -shop-out-of-space: "&5Your shop at {0}, {1}, {2}, is now full." -fee-charged-for-price-change: "&aYou pay &c{0}&a to change the price." -price-is-now: "&aThe shops new price is &e{0}" -thats-not-a-number: "&cInvalid number" -no-price-given: "&cPlease give a valid price." -average-price-nearby: "&aAverage Price Nearby: &e{0}" -shop-has-changed: "&cThe shop you tried to use has changed since you clicked it!" -nearby-shop-this-way: "&aShop is {0} blocks away from you." -no-nearby-shop: "&cNo shops matching {0} nearby." -buying-more-than-selling: "&cWARNING: You are buying items for more than you are selling them!" -not-enough-space: "&cYou only have room for {0} more of that!" -refill-success: "&aRefill success" -empty-success: "&aEmpty success" -admin-shop: "AdminShop" -unknown-owner: "Unknown" - -menu: - successful-purchase: "&aSuccessfully Purchased:" - successfully-sold: "&aSuccessfully Sold:" - item-name-and-price: "&e{0} {1} &afor &e{2}" - sell-tax: "&aYou paid &e{0} &ain taxes." - sell-tax-self: "&aYou own this shop so you don't pay taxes." - enchants: "&5Enchants" - stored-enchants: "&5Stored Enchants" - - shop-information: "&aShop Information:" - owner: "&aOwner: {0}" - item: "&aItem: &e{0}" - space: "&aSpace: &e{0}" - stock: "&aStock &e{0}" - price-per: "&aPrice per &e{0} &a- &e{1}" - total-value-of-chest: "&aTotal value of Chest: &e{0}" - damage-percent-remaining: "&e{0}% &aRemaining." - this-shop-is-buying: "&aThis shop is &dBUYING&a items." - this-shop-is-selling: "&aThis shop is &bSELLING&a items." - effects: "&aEffects: &e{0}" - - -bypassing-lock: "&cBypassing a QuickShop lock!" -that-is-locked: "&cThat shop is locked." - -how-many-buy: "&aEnter how many you wish to &bBUY&a in chat." -how-many-sell: "&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available" - -not-allowed-to-create: "&cYou may not create a shop here." -blacklisted-item: "&cThat item is blacklisted. You may not sell it" -how-much-to-trade-for: "&aEnter how much you wish to trade one &e{0}&a for in chat." - -command: - #success-created-unlimited: "&aUnlimited QuickShop created." - toggle-unlimited: "&aShop is now {0}" - no-owner-given: "&cNo owner given. Use &a/qs setowner &c" - new-owner: "&aNew owner: &e{0}" - now-buying: "&aNow &dBUYING&a &e{0}" - now-selling: "&aNow &bSELLING &e{0}" - cleaning: "&aCleaning up shops with 0 stock..." - reloading: "&aReloading..." - cleaned: "&aCleaned &e{0}&a shops" - no-type-given: "&cUsage: /qs find " - description: - title: "&aQuickShop Help" - unlimited: "&eMakes a shop unlimited" - setowner: "&eChanges who owns a shop" - buy: "&eChanges a shop to &dBUY&e mode" - sell: "&eChanges a shop to &bSELL&e mode" - clean: "&eRemoves all (loaded) shops with 0 stock" - price: "&eChanges the buy/selling price of one of your shops" - find: "&eLocates the nearest shop of a specific type." - reload: "&eReloads QuickShop from config.yml" - refill: "&eAdds a given number of items to a shop" - empty: "&eRemoves all stock from a shop" - create: "&eCreates a new shop at the target chest" - -signs: - header: "&c{0}" - selling: "Selling {0}" - buying: "Buying {0}" - item: "{0}" +# Colors: +# &0-9, &a-f +# {0}, {1}, {2}, etc are variables. You can swap them around, but adding a new variable won't work. Removing them will work + +not-looking-at-shop: "&cNo QuickShop found. You must be looking at one." +no-permission: "&cYou do not have permission to do that." +no-creative-break: "&cYou cannot break other players shops in creative mode. Use survival instead." +no-double-chests: "&cYou don't have permission to create a double-chest shop." +shop-already-owned: "&cThat is already a shop." +chest-was-removed: "&cThat chest was removed." +price-too-cheap: "&cPrice must be greater than &e$0.01" +no-price-change: "&cThat wouldn't result in a price change!" +you-cant-afford-a-new-shop: "&cIt costs {0} to create a new shop." +player-bought-from-your-store-tax: "&c{0} purchased {1} {2} from your store, and you paid {3} in taxes." +you-cant-afford-to-change-price: "&cIt costs {0} to change the price in your shop." +success-created-shop: "&aCreated shop." +success-removed-shop: "&aShop removed." +shops-arent-locked: "&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!" +shop-creation-cancelled: "&cCancelled Shop Creation." +shop-purchase-cancelled: "&cCancelled Shop Purchase." +shop-stock-too-low: "&cThe shop only has {0} {1} left" +you-cant-afford-to-buy: "&cThat costs {0}, but you only have {1}" +negative-amount: "&cDerp, can't trade negative amounts" +player-bought-from-your-store: "&c{0} purchased {1} {2} from your store." +shop-out-of-stock: "&5Your shop at {0}, {1}, {2}, has run out of {3}" +shop-has-no-space: "&cThe shop only has room for {0} more {1}." +you-dont-have-that-many-items: "&cYou only have {0} {1}." +the-owner-cant-afford-to-buy-from-you: "&cThat costs {0} but the owner only has {1}" +player-sold-to-your-store: "&a{0} sold {1} {2} to your store." +shop-out-of-space: "&5Your shop at {0}, {1}, {2}, is now full." +fee-charged-for-price-change: "&aYou pay &c{0}&a to change the price." +price-is-now: "&aThe shops new price is &e{0}" +thats-not-a-number: "&cInvalid number" +no-price-given: "&cPlease give a valid price." +average-price-nearby: "&aAverage Price Nearby: &e{0}" +shop-has-changed: "&cThe shop you tried to use has changed since you clicked it!" +nearby-shop-this-way: "&aShop is {0} blocks away from you." +no-nearby-shop: "&cNo shops matching {0} nearby." +buying-more-than-selling: "&cWARNING: You are buying items for more than you are selling them!" +not-enough-space: "&cYou only have room for {0} more of that!" +refill-success: "&aRefill success" +empty-success: "&aEmpty success" +admin-shop: "AdminShop" +unknown-owner: "Unknown" + +menu: + successful-purchase: "&aSuccessfully Purchased:" + successfully-sold: "&aSuccessfully Sold:" + item-name-and-price: "&e{0} {1} &afor &e{2}" + sell-tax: "&aYou paid &e{0} &ain taxes." + sell-tax-self: "&aYou own this shop so you don't pay taxes." + enchants: "&5Enchants" + stored-enchants: "&5Stored Enchants" + + shop-information: "&aShop Information:" + owner: "&aOwner: {0}" + item: "&aItem: &e{0}" + space: "&aSpace: &e{0}" + stock: "&aStock &e{0}" + price-per: "&aPrice per &e{0} &a- &e{1}" + total-value-of-chest: "&aTotal value of Chest: &e{0}" + damage-percent-remaining: "&e{0}% &aRemaining." + this-shop-is-buying: "&aThis shop is &dBUYING&a items." + this-shop-is-selling: "&aThis shop is &bSELLING&a items." + effects: "&aEffects: &e{0}" + + hold-to-view: "&a(Move mouse on there)" + + +bypassing-lock: "&cBypassing a QuickShop lock!" +that-is-locked: "&cThat shop is locked." + +how-many-buy: "&aEnter how many you wish to &bBUY&a in chat." +how-many-sell: "&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available" + +not-allowed-to-create: "&cYou may not create a shop here." +blacklisted-item: "&cThat item is blacklisted. You may not sell it" +how-much-to-trade-for: "&aEnter how much you wish to trade one &e{0}&a for in chat." + +command: + #success-created-unlimited: "&aUnlimited QuickShop created." + toggle-unlimited: "&aShop is now {0}" + no-owner-given: "&cNo owner given. Use &a/qs setowner &c" + new-owner: "&aNew owner: &e{0}" + now-buying: "&aNow &dBUYING&a &e{0}" + now-selling: "&aNow &bSELLING &e{0}" + cleaning: "&aCleaning up shops with 0 stock..." + reloading: "&aReloading..." + cleaned: "&aCleaned &e{0}&a shops" + no-type-given: "&cUsage: /qs find " + description: + title: "&aQuickShop Help" + unlimited: "&eMakes a shop unlimited" + setowner: "&eChanges who owns a shop" + buy: "&eChanges a shop to &dBUY&e mode" + sell: "&eChanges a shop to &bSELL&e mode" + clean: "&eRemoves all (loaded) shops with 0 stock" + price: "&eChanges the buy/selling price of one of your shops" + find: "&eLocates the nearest shop of a specific type." + reload: "&eReloads QuickShop from config.yml" + refill: "&eAdds a given number of items to a shop" + empty: "&eRemoves all stock from a shop" + create: "&eCreates a new shop at the target chest" + +signs: + header: "&c{0}" + selling: "Selling {0}" + buying: "Buying {0}" + item: "{0}" price: "{0} each" \ No newline at end of file