[ECON] ChestShop 3.7.18 (iConomyChestShop) - Chest&sign shop for economy plugins [1.8]

Discussion in 'Archived: Plugin Releases' started by Acrobot, Feb 12, 2011.

  1. Offline

    Acrobot

    An easy way to create shops - no protection plugin needed!
    You don't need to be on-line to earn money anymore!
    [​IMG]
    I've put a LOT of effort into making this plugin,
    you can donate if you appreciate my effort =)

    Requirements:
    - An economy plugin supported by Register or Vault, for example iConomy, BOSEconomy or Essentials Eco.
    Optional:
    - For additional economy plugin support - Vault
    - For Permissions: bPermissions, PEX, or any other permission plugin
    - For additional protection: LWC, Lockette, Deadbolt
    - For other item names (aliases): OddItem


    Setup:
    Copy the .jar file from the .zip you downloaded into /plugins folder.
    You can also copy the example files if you want to generate statistics page.

    Translations:
    You can change the plugin's language, here's a list of all user-made translations.
    If you want to update or submit a translation, feel free to PM me.
    Translations (open)

    Arabic - Attarhsase2
    Bulgarian - Muff1Ncho
    Czech - LordPgsa
    Chinese (Simplified) - tab415263
    Danish - Cannafix
    Dutch - speedlegs
    French- DragonSlayer875
    German - RasCas
    Hungarian - Anachen
    Indonesian - Yahya98
    Italian - Massimo1993
    Korean - Zwing87
    Norwegian - _AlexN_ and TheUnkownGamer
    Polish - Holls1
    Portugese (Brasil) - FelipeMarques14
    Russian - VADemon from http://minemania.ru/
    Slovak - LordPgsa
    Slovenian - jEErc
    Spanish - thxaaaa
    Swedish - Maxell
    Turkish - Developer
    Traditional Chinese - hellboyincs
    Vietnamese - etrubi1 from http://minevn.com/


    Permissions:
    How to create a ChestShop?
    - Place a chest, if you haven't already.
    - Place a sign 1 block near the chest (for example, above the chest)
    - On the sign, write:

    [​IMG]
    (Item name can actually be item ID or alias)
    First line will be filled in by the plugin automatically.
    Price is a combination of buy and sell price.
    You have to have B near buy price (people buy from you), and S near sell price (people sell to you).
    If you have both B and S, separate them with a colon - :
    For example:
    [​IMG]

    means that AcrobotPL wants to sell 64 diamonds for 10 currency, and buy them back from you for 5 currency.
    Also, if you put "free" instead of price, it is free to buy or sell :)

    - Now, when you finish editing the sign, if LWC is turned on in config, shop will be automatically created.
    Also, if your default protection is turned on in the config, people won't be able to break chest, sign or the block the sign is on.

    What is an Admin Shop?
    Admin shop is the shop that doesn't require a chest, because it has infinite stock.
    If you sell to it, the items will disappear, and if you buy from it, items will magically appear.
    To create one, you have to be Admin/OP. Just put "Admin Shop" (or anything specified in config file) on the first line of the sign.

    Restricting shops to some groups or regions
    You can either use permissions, or you can just put a sign ABOVE shop sign (you need to be in that group to create the sign) to restrict it to players with ChestShop.group.groupName permission
    The syntax is:
    [restricted]
    firstGroupName
    2ndGroupName
    3rdGroupName
    Only those groups will be able to use that shop

    To restrict a shop to some regions:
    - If you're using Towny, turn TOWNY_INTEGRATION on. Residents will be able to create shops in economy plots (either their or, if specified in config, any)
    - If you're using WorldGuard, you can use an experimental "chestshop" flag. Turn WORLDGUARD_INTEGRATION on and flag a region. (f.e. /region flag ChestShopRegion chestshop allow)

    Do you want to limit the maximum prices for items?
    Well, there's an app.... wait, not that : P
    You can use an experimental feature in ChestShop.
    In your config.yml, add lines like:
    max-buy-price-5: 14
    max-sell-price-5: 15

    That means that the maximum price for items BOUGHT by PLAYER is 14, and items SOLD by PLAYER using the shop is 15.

    You can also use a global setting, like this:
    max-sell-price: 200

    That means that the maximum price for items SOLD to PLAYER is 200 (if there is, for example, a max-sell-price-5 found, it will be used instead of the global sell price)

    USING SHOPS
    You could buy and sell by right and left clicking the sign for a long time.
    Now it's the only way to use the shops.
    It's SIMPLE!
    Just LEFT-CLICK to SELL to shop, and
    RIGHT-CLICK to BUY from shop.
    (This can be changed in the config file)

    DESTROYING SHOPS
    If you want to delete your old shop, simply SNEAK and destroy the sign.
    It's that easy =)

    STOCKING THE SHOPS
    You can either open the chest and stock it up, or click on your own sign - it will open chest's inventory (that way you can have chests not openable by other people for sure :D)

    ItemInfo command
    It's a simple command that shows item information.
    If you use it without any arguments, it shows you information about the item you're holding.
    If you specify item id or item name after the command, it will show you information about that item.

    Source code
    ChestShop is Open-Source =)
    You can find its code on https://github.com/Acrobot/ChestShop-3


    Thanks to:
    - kali876, ziomekYOYO and Herocraft server for testing the plugin and finding every little bug =)
    - Everyone who uses this plugin - really big thanks for this, I never thought it will be so popular
    - Everyone who provided translation - many people's lives will be easier now
    - @Nijikokun for Register
    - @LennardF1989 for awesome Persistence Reimplemented
    - @Temaska for fixing the plugin while I was on holidays
    - @VADemon for providing a great support for other users
    - @Euthyphro for his patience and really good bug spotting
    - vagrant326 for making a great price sheet
    - Epics for his great help
    :)
    If something's not working
    You can't change the sign color - that breaks the formatting.
    If that's not the issue, please give me this information, so I can help you faster.
    - CraftBukkit version (type /version in chat)
    - ChestShop version (type /csversion in chat)
    - Your economy plugin (iConomy? BOSEconomy? other one?)
    - Have you got any Permission plugin? Which one?

    [​IMG]
    Changelog (open)

    Changelog can be found on BukkitDev - http://dev.bukkit.org/server-mods/chestshop/files/
     
  2. Offline

    LT.killer

    i get this error

    Code:
     Could not pass event PLAYER_INTERACT to iConomyChestShop
    java.lang.NullPointerException
            at java.io.FileOutputStream.<init>(FileOutputStream.java:201)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
            at java.io.FileWriter.<init>(FileWriter.java:78)
            at com.Acrobot.iConomyChestShop.Logging.log(Logging.java:29)
            at com.Acrobot.iConomyChestShop.ShopManager.buy(ShopManager.java:80)
            at com.Acrobot.iConomyChestShop.iConomyChestShopPlayerListener.onPlayerInteract(iConomyChestShopPlayerListener.java:90)
            at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:254)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:207)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:521)
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
    what can i do to
     
  3. Offline

    Acrobot

    @Latros
    Yes, it is.

    @creec
    @Atilme
    Wait, that's not a fix. Gonna test it now.
    EDIT: I can make admin shops o.0
    Do you have iConomyChestShop.shop.admin node?

    @banana_poop
    Sorry :3
    It's easier for me, because every time I change the file, I can change the post too.

    @LT.killer
    How did you even do this? Anyways, just download the config from .zip file and try with it.

    @riuthamus
    Thanks :)
    As for the colors on the sign - I don't know. Unfortunately, bukkit dev's changed it so it strips extra characters from the sign, and I don't know if color sign is stripped too :/

    What do you mean by that?
     
  4. Offline

    riuthamus

    well with BOSEcon we have banks, just like in iConomy, maybe you already have it coded but I dont know how, to make a store that would charge or give money to a bank. The owner of the bank should be the owner of the store, just a thought. Also group permissions would be nice too, so groups could have a store, again the groups bank would be used to charge the money. Just some thoughts.
     
  5. Offline

    Acrobot

    @riuthamus
    Oh, nice thought :p
    For now, only admins can create shops with other account, for example "Bank", and then it would charge bank, but it's a nice feature. I am currently learning databases, they seem so helpful :)
     
  6. Offline

    habbah

    hey i love this addon but it is conflicting with another plugin i have they both use "/chest" command anyway i can change this?
     
  7. Offline

    Acrobot

    @habbah
    You don't have to use chest command, you can use
    /chBuy and /chSell
    /buy and /sell

    or if you have sneakMode: true in the config, you can just left-click the sign to sell :)
     
  8. Offline

    Atilme

    I'm an op, so no, I don't inherit the permission from anything, but I was under the impression that I could use any command / permission node anyway, is this not the case with your plugin?
     
  9. Offline

    Acrobot

    @Atilme
    Hmm.. If you have no permissions plugin then yes, otherwise it's strange, because it doesn't allow me. In fact, the code is
    Code:
    public static boolean hasPermissions(Player player, String permission) {
            if (Permissions != null) {
                return Permissions.has(player, permission);
            } else {
                if (permission.contains("exclude")) {
                    return false;
                }
                if (permission.contains("admin")) {
                    return player.isOp();
                } else {
                    return true;
                }
            }
        }
    
    Which checks if the Permissions plugin is enabled, otherwise if player is OP they can do anything.
     
  10. Offline

    Atilme

    Oh, I see, so even if you're an op, you won't be able to do it unless you have the permission, thanks. Might I recommend you change that so it checks if they're an op first, in which case it works no matter what?
     
  11. Offline

    Acrobot

    Okay, a quick quiz:
    who can guess what THIS does?

    [​IMG]

    I love databases now :)
    Also, I added 300-ms (3/10 of a second) delay between transactions. (value can be changed, but it's hard-coded)
    If everything goes right, the average prices etc will be done soon :)
     
    imaxorz likes this.
  12. Offline

    MineralMC

  13. Offline

    Acrobot

    @MineralMC
    Thanks for information!

    I'm currently making it work with iConomy 5.0, but I must comment-out a lot of lines, because I am making database support :p

    EDIT: Done, gonna be relased soon.
     
  14. Offline

    Atilme

    Damn ninjas! I was gonna post that XD
    Oh! and does the db file... Oh, I don't know, add a database?
     
  15. Offline

    Acrobot

    Eh, the new iConomy is buggy. Typed "/money" and what i get?
    CommandException :/
     
  16. Offline

    MineralMC

    Speaking of which, are you going to support the standard DBMS, or just your own engine? Will I be able to link chestshop into my local MySQL server?

    Have reported it to Nijikun. Pop into #iconomy if you get a chance.
     
  17. Offline

    bfanboy

    Ok. CB 740 on v 2.54 and Lockette 1.3.6. Trying to buy from a newly created shop I get, "Your inventory is full" Only problem is my inventory is not full. I am able to buy from shops that were created long ago. No errors in server log. Any ideas?

    Figured it out. User was selling porkchops in stacks of 16. This would require the buyer to have 16 free slots in inventory. Dumb dumb.
     
  18. Offline

    Plush Ninja

    Thanks for adding the amount bought/sold to the log file. Using that, I wrote a Perl script to collect market data and write a neat price table with 28-day moving weighted averages. I'm releasing it here for anyone interested to use and modify it on their servers.

    Here's the code: http://pastie.org/1849454

    The configurable stuff is at the top. You'll need Perl and a web server to host the generated page. We are using phpBB and include the output on another page. The headers and footers can be written to fit any occasion.

    Sample (live) output at our website: http://mintyfreshcreepers.net/price.php

    Sorry if this was a smidgen off topic. Looking forward to database support in iConomyChestShop -- yet easier log analysis. :)
     
  19. Hey man. Every time I try to make a shop it says: [Permissions] You can't make this type of shop!

    CB version: 740
    Permissions version 2.7.2 Phoenix
    Permissions config file:
    Code:
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'essentials.home'
                - 'essentials.sethome'
                - 'essentials.msg'
                - 'essentials.rules'
                - 'essentials.motd'
                - 'essentials.list'
                - 'essentials.spawn'
                - 'essentials.help'
                - 'physicalshop.build'
                - 'physicalshop.use'
                - 'lockette.user.create.*'
        Admins:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'essentials.depth'
                - 'essentials.tpo'
                - 'essentials.tpohere'
                - 'essentials.home'
                - 'essentials.sethome'
                - 'essentials.warp'
                - 'essentials.warp.list'
                - 'essentials.warp.*'
                - 'essentials.delwarp'
                - 'essentials.msg'
                - 'essentials.rules'
                - 'essentials.motd'
                - 'essentials.list'
                - 'essentials.spawnmob'
                - 'essentials.clearinventory'
                - 'essentials.clearinventory.others'
                - 'essentials.ping'
                - 'essentials.ban'
                - 'essentials.mute'
                - 'essentials.kick'
                - 'essentials.unban'
                - 'essentials.invsee'
                - 'essentials.time'
                - 'essentials.god'
                - 'essentials.heal'
                - 'essentials.spawn'
                - 'essentials.setspawn'
                - 'essentials.weather'
                - 'essentials.thunder'
                - 'essentials.lightening'
                - 'essentials.help'
                - 'worldedit.*'
                - 'worldguard.*'
                - 'physicalshop.admin'
                - 'physicalshop.build'
                - 'physicalshop.use'
                - 'lockette.user.create.*'
                - 'lockette.admin.create.*'
                - 'lockette.admin.bypass'
                - 'lockette.admin.snoop'
                - 'adminchat.everything'
                - 'iconomychestshop.shop.create'
                - 'iconomychestshop.shop.buy'
                - 'iconomychestshop.shop.sell'
                - 'iconomychestshop.shop.admin'
                - 'iconomychestshop.command.iteminfo'
    users:
        tiemposinropa:
            group: Admins
        nakedtown:
            group: Admins
    ChestShop config file:
    Code:
    sell: true
    distance: 1
    position: 'DOWN'
    protection: true
    
    LWCprotection: false
    signLWCprotection: false
    logFilePath: "plugins/iConomyChestShop/iConomyChestShop.log"
    sneakMode: true
    allowUsedItemsToBeSold: false
    stackUnstackableItems: false
      
    separatingLineAfterTransaction: false
    
    #allowUsedItemsToBeSold - allows used items to be sold. WARNING. the tools will be "fresh" if player sells them. I don't reccomend it, really.
    #protection - do you want to use anti-stealing protection?
    #sell - do you want to activate selling?
    #distance - distance between the chest and the sign
    #position - position of the chest, goo.gl/YItRO
    #LWCprotection - do you want to protect the chests with LWC?
    #signLWCprotection - do you want to LWC-protect the sign? Warning: it will show LWC message every transaction.
    #logFilePath - where will the log be stored?
    #sneakMode - if on, left-clicking the sign automatically sells to shop, if you want to break the sign, just sneak and break it.
    #separatingLineAfterTransaction - if on, after every transaction there will be one line of "------" in the chat
    #stackUnstackableItems - if turned on, plugin uses default MinecartMania behavior - stacks food, etc. I reccoment to turn it OFF!
    
    # prefix will be dispayed at the beggining of every message.
    # you can use terms like <buyer>, <amount> or <item> in messages, however
    #     only certain messagess offer this.
    #
    #
    # <buyer> - nick of the person who bought.
    # <owner> - nick of the person who own the shop.
    # <amount> - amount of item
    # <item> - name of item
    # <money> - amount of money with iConomy currency
    #
    # You can always use hMod colors, like
    # &1, &f etc...
    # For example: This is my&6 golden text.
    
    #MAXIMUM OF 55 CHARACTERS WITH PREFIX!
    
    #Experimental: Try changing the prefix to '                          &a[Shop] &f                                             '
    #The text will be centered!
    lang:
        prefix: '&a[Shop] &f'
        Somebody_sold_items_to_your_shop: '<seller> sold <amount> <item> for <cost> to your shop!'
        Somebody_bought_items_from_your_shop: '<buyer> bought <amount> <item> for <cost>!'
        Your_shop_is_out_of_stock: 'Your <item> shop is out of stock!'
        You_cannot_use_your_own_shop: "You can't use your own shop!"
    
        You_bought_items: 'You bought <amount> <item> from <owner> for <cost>.'
    
        Your_inventory_is_full: 'Your inventory is full!'
        You_have_got_not_enough_money: "You don't have enough money!"
        Shop_is_out_of_stock: 'This shop is out of stock!'
    
        You_have_not_enough_items: 'You have not enough items to sell!'
        You_sold_items: "You sold <amount> <item> for <cost> to <owner>'s shop."
        Chest_is_full: 'This chest is full!'
    
        Seller_has_not_enough_money: "Seller has not enough money!"
        Seller_has_no_account: "Seller's account doesn't exist!"
        No_selling_to_this_shop: "Shop owner doesn't want you to sell here!"
        No_buying_from_this_shop: "Shop owner doesn't want you to buy here!"
    
        Your_balance: 'After transaction you have <money>.'
    
        Shop_is_created: 'Your shop has been successfully created!'
        Shop_cannot_be_created: "You have no chest set up!"
        Shop_was_LWC_protected: "Your shop was successfully protected with LWC."
    
        Mode_changed_to_sell: 'Mode set to selling!'
        Mode_changed_to_buy: 'Mode set to buying!'
    
        You_tried_to_steal: "Don't steal!"
    
        iteminfo: "&aItem ID and names:"
        incorrectID: "Incorrect item ID!"
        Couldnt_fit_on_sign: "Couldn't fit something on the sign!"
        Negative_price: "Can't make shop with negative buy/sell price!"
        Incorrect_item_amount: "The item amount you specified is invalid!"
     
    iponu7 likes this.
  20. Offline

    Brady_

    Can someone please host the config or the zip file somewhere else? I have to remote connect to my VPS and I have to use the wget command to download files and it won't work with files like this that require being logged in somewhere. It would help a lot, thanks in advance.
     
  21. Offline

    Luksor

    Download it on your PC, upload on Dropbox , and use wget on your VPS to download it.
     
  22. Offline

    Adellus

    Having an issue selling birch saplings, how do you set up a shop that will recognize the difference? As of now the regular sapling shop wont even register the birch Sapling
     
  23. Offline

    Acrobot

    @Plush Ninja
    Thanks :) I'll link to it in main post, if you don't mind :)

    @Adellus
    ID:data value?
    For example, for birch:
    17:2

    @Brady_
    I'll host .zip files on github in the future relases.

    @John David Wright
    Permissions are case-sensitive.
    Also, admins can use "*" node, which will use all of the nodes.
     
  24. Offline

    Adellus

    So in other works instead of writing sapling i write 17:2 ?
     
  25. Offline

    Acrobot

    @Adellus
    Oh, sapling.
    It's actually block id number 6, so
    6:2
    or
    sapling:2
    or
    sap:2
    or any combination of name/short name/id and ":<data value>"
     
  26. u need a node 4 the admin shop ;)
     
  27. Offline

    Dylan Helling

    Ok I really want to use this plugin since I have iConomy installed, but when after I installed it and tried to use it, it said no economy plugin found. How can I fix this?
     
  28. Offline

    Acrobot

    @Dylan Helling
    Which version of iConomy do you have?

    And which .zip file did you download?

    @manniL
    If that is a suggestion - there is iConomyChestShop.shop.admin
     
  29. Offline

    Dylan Helling

    Ok nevermind on that problem. I fixed it :) but I have another. Ok so I'm trying to setup a server shop, but I don't want the shop connected to me. I want to be able to use it also. Is there anyway to do this?
     
  30. Offline

    Acrobot

    @Dylan Helling
    There are several ways to do it.
    • Create fake iConomy account with /money create <name>, and create a shop for it (if you have iConomyChestShop.shop.admin, you can put whatever you want on the first line)
    • Create an admin shop (put "admin shop" in the first line)
    • Create a shop for other player - almost the same as the first way.
     
  31. Offline

    Dylan Helling

    ok will these methods work even though I'm listed as an admin
     

Share This Page