Inactive [ECON] BetterShop 2.0 - A 'Better' Server-wide Shop - Spout compatible :) [1240]

Discussion in 'Inactive/Unsupported Plugins' started by jascotty2, Jul 6, 2011.

  1. Offline


    BetterShop - The "better" global command-based shop
    Version: 2.0
    Download: (static jar) BetterShop.jar
    download page with older versions

    BetterShop is now primarily on BukkitDev

    (you can still come this forum for some help, though)

    this plugin (original concept) was first made by jjfs85 here
    however, he stopped development (that i know of) once i started

    plugin support
    for economy, currently dependent on one of:
    Permissions support

    Help support

    Fully configurable colors and message text in config.yml file
    shoplist can have text alignment (read config for more info): <item> <l(eft-aligned)> <buy and sell info>
    - uses minecraft font character spacing, so is very close to perfectly aligned in chat
    shoplist can optionally not show listing tail (or head, but recommended to leave <page> of <pages>)
    Items can be colored in the new itemsdb.yml file
    also in itemsdb.yml: kits!
    - define your own kits that the shop can sell
    - three examples provided, edit and add to your liking
    Configurable Options:
    -max pagesize when printing shoplist
    -whether to broadcast all transactions publicly
    -name of the pricelist file/table
    -customsort: a custom sorting order, so you can have items at the top of the shop list
    -allowbuyillegal: if someone without BetterShop.admin.illegal can buy illegal items
    -whether maxstack should be honored
    -if used tools can be bought back
    -default color for items
    - and more!

    shop flexibility
    shopcheck will run a name comparison check, and return all matching items
    Item sub-type support for dye colors, cloth colors, etc: magentacloth = 35:2 = cloth:magenta
    "all" is a valid amount when buying or selling: "/sell cobblestone all" or "/sell all cobblestone"
    damaged tools can be resold for an adjusted value of sellprice*(1-(damage/maxdamage))
    buystack can be given multiple items, or number of stacks: "/buystack wool 5" or "/buystack wool blackdye reddye"
    shopsellall can be given multiple items (/sell all cobble gravel flint dirt)
    plural-insensitive items: if not found, will check if plural & remove "s"
    not just items can be bought anymore: can now buy LivingEntities, like dogs (wolf)
    signs can be used for buying & selling
    - first line: [BetterShop] (not case-sensitive)
    - second line: action: buy [amt], buyall, buystack, sell [amt], sellall, sellstack
    - third line: item (name, id, etc)
    - fourth line: unused (was going to make price, but decided on pricecheck instead)
    - to activate, someone with BetterShop.admin.makesign must left-click the sign.. the first line will change color when active
    - left-click for price check (or activate), right-click to buy/sell
    - if a unauthorized player destroys a block a sign is on, is canceled
    item categories
    - can search for items by category (in shoplist)
    players using Spout (if installed & enabled) can use a GUI Menu for buying & selling
    - default button is 'b'
    - displays items in shop in top half
    - item detail below with # in stock, buy/sell price, & buttons to buy & sell
    - amount to buy/sell can be set in text box or with up/down buttons

    Every item and subtype can be priced differently
    Disable buying or selling of an item by giving it a price of -1 (0 makes it free)
    command aliases to stop carpal tunnel
    many commands have sub-aliases.. eg. shoplist kits will run shoplistkits
    MySQL pricelist support
    MySQL pricelist can be cached for a given timespan (decreases table selects) (flatfile is cached until manually updated)
    Transaction records (MySQL or flatfile as .csv)
    Downloads mysql-bin.jar dependency automatically
    buy/sell cap in program set to 999,999,999 (not that you'd be using that much, but the cap is to prevent other errors)
    if encounters errors while editing a player's account, will attempt to reload iConomy (i've had issuses with it before)(may remove in a future update.. seems to work better now)
    can backup the current pricelist: /shop backup
    can restore from backup: /shop restore <file>
    can import new prices in a batch from a csv (or old yml format) : /shop import <file>
    on start, can check the download page to see if there is an update available
    shop can be given a finite stock from which to buy & sell
    /shop ver[sion] to check the current version & see if there's an update
    /shop update to manually download & install the most recent version
    MinecraftIM support: forward errors or all messages
    checks for missing & unused configuration nodes
    strings have default values if missing
    auto error reporting added (can be disabled)
    custom message you can send with the error report
    help main page integration can be disabled
    global shop can be disabled & only allow signs to be used
    can use permissions to define discounts for certain users
    - uses nodes in ""​
    - nodes defined in config under discountGroups​
    - ex: discountGroups:​
    VIP: 10 # gives 10% discount to players with​

    Version 2.0 - 9/24/11
    near-complete rewrite
    - more modular, should be easier to add new features
    added region-based shop support
    - just main shop for now
    - config modes:
    - - shop.commandShop: global
    - - - regions are areas where command-based shop access is disabled
    - - shop.commandShop: regions
    - - - globally disabled, except for within regions
    - - shop.commandShop: both
    - - - allows command-based shop access from anywhere
    - - shop.commandShop: none
    - - - cannot use commands (or spout) to use the shop
    - regions are defined by first selecting a region in worldguard
    - - after regions have been defined, can put the WorldEdit.jar in the lib folder
    now checks from 2 mirrors (still on git)
    - not really needed, but the code behind it looks cleaner
    finally adopted some license to support open development.
    - now the source is licenced under the GNU General Public License
    added pages menu option (default) so spout scrolling goes by page, not column
    added a fix for a spout button error
    fixed a spout error where may show amount stock can sell, not buy
    added category switching (spout)
    - can use 'cycle' for a button to cycle through the categories (shows more per-page)
    - or use 'tabbed' for buttons at the top that can be selected
    chest shop interface added :D
    - to define a chest, point at the chest & type "/shop chest define"
    - automatically detects double-chests
    - multiple users can use the same chest shop
    - - each user gets a customized chest screen
    - - items in the display show either max stack, or max of that item the user can afford
    - setting for "chestSellBar", which allows selling to a chest which is full (without buying anything)
    tnt explosion cancelation settings for sign/chest shop added
    - should be more efficient than prior method
    commandlog format moved in config & added more formatting options
    updated Register methods (fixes iCo6 errors)
    added a rudimentary spell check routine
    - if an item name doesn't match at first, and there is 1 match for closeness, returns that item
    sign shop handling rewrote
    - should be more efficient
    - can now define custom prices for transactions
    - - 4th line contains cost, doen't have to just be a number
    - - - "1.23", "$1.23", "1.23 Dollars", "$1.23 total" are all acceptable
    - - for a given amount, define the total cost
    - - if using "sellall" or "buyall", define unit cost
    categories have been implemented in buy & sell
    - can sell all items in a category, or buy an amount of each item in a category
    - ex. "/sellall food"
    sign & chest shops are protected from endermenv (if shop.(sign & chest)DestroyProtection = true)
    sql routines updated for foreign locales

    Full changelog can be found in the readme on git

    Support development!
    if you really like this & don't want to see it go by the wayside, [​IMG]
    (i make no money maintaining plugins)
    if you can't donate, at least a "like" would help ;)
  2. Offline


  3. Offline


    YAY! new thread is new and nice! :p
    keep up the great work.
  4. Offline


    Just one thing, where can I find a good pricelist for this mod?
  5. Offline


    there are two examples included
    but i wouldn't mind if other server owners would contribute, too ;)
  6. Offline


    Those 2 are incomplete and frankly a little ridiculous with prices for the more important materials.
  7. Offline


    well. they're examples ;)
    edit to something of your liking, and upload here if you'd like to share
  8. Offline


    I would LOVE to see a trade command. Other than that this plugin is great and thanks for continued development!
  9. Offline


    Can I sell through signs?
  10. Offline


    confused how you could trade with a shop.. can you elaborate what the trade portion would do?

    |  [BetterShop]  |
    |   sell #/all   |
    |item/inv/inhand |
           |  |
           |  |
  11. Offline


    And buy is instead of sell but then the same right?
  12. Offline


    i think they mean a player to player sort of trade. so say PlayerA could sell a stack of cobble straight to PlayerB at a price they set, which could be more or less than the global market price.

    on another note, is dynamic pricing on the books/ in development? that's the only thing this plugin is really missing atm (in my opinion anyway :))
  13. Offline


    I would also love to see dynamic pricing!
  14. Offline


    Did the maxstack feature of the itemsdb get dropped? If so is there any chance to bring it back? We really liked being able to buy a stack of bread from the shop.
  15. Offline


    that had not been dropped (still works) but that item information now is stored in the plugin (so it no longer depends on that file)
    if you want to buy stacks of items, try using shop.usemaxstack: false
    (in the config)
  16. Offline


    I have that set to true. But where do I specify what the maximum stack is?
    this is what I have for bread:
            name: Bread
            maxstack: 4
    But /buystack bread still only buys 1 bread.

    This used to buy 4 bread in a stack with
  17. Offline


    fixed unknown bukkit item naming in itemsdb (more update-proof)
    - fixed custom maxstack having been removed
    better handling of iConomy nullpointer errors
    fix buying ghasts (also not of "creature")
    misc. null fixes

    1. mistakenly told you true; should be false (for ignoring stack & getting 64)
    2. looked over the code & realized i'd removed the maxstack option
    so: i put it back, so the settings you have now should work as you want them to​
  18. Offline


    title is missing recommended CB version tested against

    (and also the formatting is a mess if you don't mind me saying)
  19. Offline


    I recommend adding spoilers to hide all of the long sections :)
  20. Offline


    When I sell something the money does not get added to one of my account, buy buying works fine....
    Some other plugin was overwriting the Bettershop command... Nevermind :(
  21. thx i did think BetterShop is lost

    work for 1.7?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  22. Offline


    953 is for 1.7 [brickblock]:rolleyes:[brickblock]
  23. Offline


    I'm not gonna use this plugin anymore since my server is going anarchy now. Though I always loved this plugin. =D

    <Edit by Moderator: Redacted mediafire url>
    It's a copy of I think yours, jascotty2, but with prices I thought made more sense + a mob spawner for $500,-
    So I basically edited yours... But others can use it if they want ;P

    Hope you keep developing your awesome plugin!
    Last edited by a moderator: Nov 27, 2016
  24. Offline


    @ jascotty2 i cant conenect to my mysql DB, but i am sure i do nothing wrong in the configfile.. i use the same config for many other plugins:
    12:53:24 [INFO] [BetterShop] Newer BetterShop version found on git (Sat Jul 09 00:18:45 CEST 2011)
    12:53:25 [SEVERE] [BetterShop] Error while creating table
    java.sql.SQLException: Error while creating table
        at com.jascotty2.MySQL.MySQLPriceList.createPricelistTable(
        at com.jascotty2.MySQL.MySQLPriceList.<init>(
        at com.jascotty2.Shop.PriceList.loadMySQL(
        at com.nhksos.jjfs85.BetterShop.BSPriceList.load(
        at com.nhksos.jjfs85.BetterShop.BetterShop.onEnable(
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(
        at net.minecraft.server.MinecraftServer.e(
        at net.minecraft.server.MinecraftServer.a(
        at net.minecraft.server.MinecraftServer.init(
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-env.BetterShop(ID    INTEGER  NOT NULL,SUB   TINYINT  NOT NULL,NAME  VARCHAR(25' at line 1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
        at java.lang.reflect.Constructor.newInstance(
        at com.mysql.jdbc.Util.handleNewInstance(
        at com.mysql.jdbc.Util.getInstance(
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
        at com.mysql.jdbc.MysqlIO.sendCommand(
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
        at com.mysql.jdbc.ConnectionImpl.execSQL(
        at com.mysql.jdbc.PreparedStatement.executeInternal(
        at com.mysql.jdbc.PreparedStatement.executeUpdate(
        at com.mysql.jdbc.PreparedStatement.executeUpdate(
        at com.mysql.jdbc.PreparedStatement.executeUpdate(
        at com.jascotty2.MySQL.MySQL.RunUpdate(
        at com.jascotty2.MySQL.MySQLPriceList.createPricelistTable(
        ... 14 more
    12:53:25 [SEVERE] [BetterShop] Failed to connect to MySQL database mc_test-env
    12:53:25 [SEVERE] [BetterShop] cannot load pricelist: null
    12:53:25 [SEVERE] [BetterShop] null
        at com.jascotty2.Shop.PriceList.close(
        at com.nhksos.jjfs85.BetterShop.BetterShop.onDisable(
        at com.nhksos.jjfs85.BetterShop.BetterShop.onEnable(
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(
        at net.minecraft.server.MinecraftServer.e(
        at net.minecraft.server.MinecraftServer.a(
        at net.minecraft.server.MinecraftServer.init(
  25. Offline


    never thought of any good reason to put a hyphen into a database / table name... makes it more difficult to work with if you need to edit from the command line..

    so.. i found a fix for you, anyway

    weather "easter egg" removed (was free to "buy" weather events)
    updated MySQL parameters to allow some special characters in names
    temp. fix for inventory data error until bukkit merges my fix
    other misc. null fixes
  26. Offline


    Hey can I please get some help, How do you set it up so people can buy a "example" diamond pick axe and they can sell it right back or w.e for the set price or if they use it and its almost gone or somewhere in between it is a different amount. I saw it under config but I do not get it. can someone give me a example please. Use a pick axe being sold for 125, and regular by back (unused) is 100.
  27. Offline



    I am happy to see this plugin up to date again. I updated my price list that I would like to share with everyone.
    Here is the .csv :

    I also made a corresponding .ods (Open Document Spreadsheet) that calculates a lot of the values by itself. If an item needed to be furnaced, the cost of the coal required is calculated. Though, the time required for the furnacing is not calculated. All the fields in green are calculated automatically. The fields in yellow shouldn't be changed. The fields in white can be modified. The default value for selling is 0.5*buyprice.
    Here is the .ods :

    To save the .ods document as a .csv, click File, then Save as. Next to Save as type, select Text CSV and click Save. A window should appear asking the Field delimiter and the Text delimiter. For the Field delimiter, select the comma (,). For the Text delimiter, make sure nothing is entered (click on the field, and you should be able to delete the default (")).

    Hope this helps a lot of server admins out there.
  28. Offline


    Does this support Permissions Bukkit?
  29. Offline


    If it does, it isn't working. I have neither node listed in group permissions yet I can still use shop commands. =/
  30. Offline


    when I run the Plugin using Mysql with a lot of Items in it I get this error:
    2011-07-23 13:56:44 [SEVERE] [BetterShop] failed to run COMMIT on database
    java.sql.SQLException: failed to run COMMIT on database
        at com.jascotty2.MySQL.MySQLPriceList.commit(
        at com.jascotty2.Shop.PriceList.close(
        at com.nhksos.jjfs85.BetterShop.BetterShop.onDisable(
        at org.bukkit.plugin.SimplePluginManager.disablePlugin(
        at org.bukkit.plugin.SimplePluginManager.disablePlugins(
        at org.bukkit.plugin.SimplePluginManager.clearPlugins(
        at org.bukkit.craftbukkit.CraftServer.reload(
        at com.earth2me.essentials.Essentials.onCommandEssentials(
        at com.earth2me.essentials.Essentials.onCommand(
        at org.bukkit.command.PluginCommand.execute(
        at org.bukkit.command.SimpleCommandMap.dispatch(
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
        at net.minecraft.server.NetServerHandler.handleCommand(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.Packet3Chat.a(
        at net.minecraft.server.NetworkManager.b(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(
    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 83,704,607 milliseconds ago.  The last packet sent successfully to the server was 83,704,619 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
        at java.lang.reflect.Constructor.newInstance(
        at com.mysql.jdbc.Util.handleNewInstance(
        at com.mysql.jdbc.SQLError.createCommunicationsException(
        at com.mysql.jdbc.MysqlIO.send(
        at com.mysql.jdbc.MysqlIO.sendCommand(
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
        at com.mysql.jdbc.ConnectionImpl.execSQL(
        at com.mysql.jdbc.StatementImpl.executeUpdate(
        at com.mysql.jdbc.StatementImpl.executeUpdate(
        at com.jascotty2.MySQL.MySQL.commit(
        at com.jascotty2.MySQL.MySQLPriceList.commit(
        ... 26 more
    Caused by: Broken pipe
        at Method)
        at com.mysql.jdbc.MysqlIO.send(
        ... 33 more
    2011-07-23 13:56:44 [INFO] BetterShop now unloaded
    Hmm, I rebooted my Linux Server and now it work:
    2011-07-24 07:29:01 [INFO] Loading BetterShop version ...
    2011-07-24 07:29:01 [INFO] [BetterShop] Notice: Unused Configuration Nodes:
    strings.commandlog, strings.listalias
    2011-07-24 07:29:03 [INFO] [BetterShop] Newer BetterShop version found on git (Tue Jul 19 22:35:07 GMT 2011)
    2011-07-24 07:29:03 [INFO] [BetterShop] MySQL database **ip**:Minecraft/BetterShop loaded.
    2011-07-24 07:29:03 [INFO] [BetterShop] Attached to iConomy.
    2011-07-24 07:29:03 [INFO] [BetterShop] Attached to Permissions.
    2011-07-24 07:29:03 [INFO] BetterShop version is enabled!

Share This Page