[REQ] SSShop - Simple Sign Shop (not a chest shop)

Discussion in 'Archived: Plugin Requests' started by kalez, Feb 2, 2012.

  1. Offline


    Not really a request, kind of, but more an idea that should be made for everyone out there who wants shop buildings that hold more than just a few chest shops. There are just too many chest shops and no (updated) sign shops!
    ("By kind of" i mean i may be forced to find a new shop plugin and use this soon, but im not sure)

    I believe plugins should contain the least amount of commands as possible.

    - Shops would be made by placing a sign with Line 1: [shop] / [donate], Line 2: infinite / finite, Line 3: buy: $ /sell: $, Line 4: <item id>
    (Note: Donation shops would not have lines 2 - 4, sell shops would not have line 4)
    - Shop info is added to a txt file, including xyz coordinates, owner, shop types, price, and items contained, etc. All shops would be in the same txt file, one shop per line. (if infinite, "owner" would be server, since all money the shop obtained would go to the void)
    - Shops either buy or sell, they do not do both.
    - Shops only sell or buy 1 type of item.
    - To add more items to a sell shop after a sign is placed, shift+clicked the sign with the items being sold in hand, followed by chat asking the amount, OR the entire amount of what is in hand is added to the shop when shift+clicked.
    - Shift+click again to add more items to a shop by either method above.
    - If a buy shop, the item id is added to line 4, after which it is converted to the item name when Done is clicked.
    - If a sell shop, when the items are added to the shop, line 4 is updated with the item name.
    - Shift+click a sign shop with an empty hand will cause chat to display the amount of items a shop contains, and then request the amount of items you wish to remove. Walking away, or typing a non-number will close the shop.
    - Clicking a shop will cause chat to display the amount of items in a shop, and request the amount of items you wish to purchase, which is then typed into chat.
    - To remove a shop, aim at a shop sign and type "/ssshop close". Chat will ask you if you wish to close the shop as a precaution, and then will remove the break protection and blank out all lines on the sign.
    - If a finite shop is removed, all items are returned, unless the owner does not have room, which then the remove is refused.
    - Only the shop owner or an Op can remove a shop.
    - Only Ops can make Infinite.
    - isOp permission true/false option in config, we dont use permissions, but also add any additional permission system compatibility that you wish.
    - Optional config limit to how many shops a player is allowed to make, with a separate option for donations signs. -1 is unlimited.
    - Shops have break protection, including the block behind the sign if on a wall.
    - Support BOSEconomy/Vault/any other economy plugins.

    - Release to the public.

    /ssshop help - display instructions for making a shop
    /ssshop close - removes break protection and clears sign text
    /ssshop reload - reloads config

    (Help instructions)
    Line 1: [shop] / [donate]
    Line 2: infinite / finite
    Line 3: buy: $ /sell: $
    Line 4: <item id>
    (Note: Donation shops do not require lines 2 - 4, Sell shops do not require line 4)
    (Sell shop is clicked)
    Shop contains ## itemname's at $$ each. Type the amount you wish to purchase.
    ("/ssshop close" is typed)
    Type Y to confirm, N to cancel.
    (Shop is clicked with an empty hand)
    Shop contains ## itemname's. Type the amount you wish to remove.
    (Buy shop is clicked)
    Shop purchases ## itemname's at $$ each. Type the amount you wish to sell.

    Im sure there is something i missed...
  2. Offline


    Anyone interested?
  3. Offline


    there was an old plugin like this (called signshops)
    probably with the new event system it broke, but i used it up to 1.8
  4. Offline


    yeah all of the sign only shops were never updated, and this covers a lot of the things we currently use and ive seen in other shops. pretty similar to showcase, but without the floating items and such.
    nunber1_Master likes this.
  5. Offline


    try the EssentialsEconomy sign shops,
    they are updated and still work ;)
  6. Offline


    i avoid Essentials like a plague. weve had huge problems with them in the past.
    MuisYa likes this.
  7. Offline


    Ive never had a problem with essentials, and Ive had my server for quite a while
  8. Offline


    Anyway, if anyone had a hand at this, it would be greatly appreciated. Lets try and break away from the chest shops :p
  9. Offline


    I love you, +1
    kalez likes this.
  10. Offline


  11. Offline


    I have no idea what the guy above me just said, but the point is, i dont want Essentials just to have a sign shop, and there should be more choices for such a shop than just Essentials. there are tons of chest shops, so why cant there be an alternative sign shop.

    Except it doesnt use money. Thanks for the post though =b
  12. Offline


    SignShops :D Way simpler then that bank plugin. I'll will MOST LIKELY be doing this one.
  13. Offline


    Haha :p thanks!

    Edit: Will you be able to or can someone else still have a crack at it? Just checking.
  14. Offline


    If no one else takes it, I'll probably give it a shot.
  15. kalez What is your favourite outdated sign shop plugin? Tell me and I'll try my best to update it.
  16. Offline


    Cant say. Showcase was our first shop plugin, and all the sign plugins were outdated by the time we started using shops.

    That would be great! Guess it depends on what ThatBox says :p
  17. Offline


    I say let Fyre go ahead! ;p
  18. Offline


    Well then, I'll post when I have an Alpha.
  19. Offline


    Anyone doing this still? I would like to do this...
  20. Offline


    Awesome! Thanks so much :D
  21. Offline


    Alright time for an update, it's going much better than I expected, but there's still a lot of coding involved, so it'll take a day or two at least.

    EDIT: Also what economy plugin do you use? I want to make sure I have support for it so we can test the plugin, I'll add others later.
  22. Offline


    We use BOSEconomy 7 and Vault, so im assuming Vault would be the prefered if you are going to release it to the public, otherwise do whatever is easiest.

    And dont worry about it, take your time.
  23. Offline


    Looks like I'll have to, I'm currently in the middle of the long and boring process of creating a HashMap containing every ID in the game matched with its Item Name.
  24. Offline


    Why not use an existing items database? OddItem is one, and it has common item name aliases built-in as well.

    (or you could iterate net.minecraft.server.Item.byId, calling l() on each, but this won't always give you the proper names, and is more involved if you want to support subtypes)
  25. Offline


    Because I can't use integers, I'm using a HashMap<String, String>, which is much faster, because you don't need to parse the id's with subtypes, like 35:15. I also want to have as few dependencies as possible.

    I can't use the Bukkit database because Bukkit doesn't have string names for items defined by their damage values, it would return black wool(35:15) as white wool(35), and it would return Lapis(351:3) as Ink Sacks(351).

    Sorry for the double post but this is important, a single line of a sign has a maximum of 15 characters. Most items can be abbreviated to meet this criteria, but Potions will definitely not. With this in mind I've decided to use a character key, with a star(*) at the end of the name indicating a splash potion, and a plus sign(+) at the end of the name indicating an extended potion. Opinions?

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


    hmm hadnt thought of that. the * and + sound perfectly fine to me. maybe even add something in the config to make it customizable if you want, up to you. id how much you want to allow to be customizable, but the more the better :p. ultimately, though, if youre making it like i showed above, all potions could just read "Potion" on the sign and then when clicked the chat will say:
    "Shop contains 10 Splash Potion of Healing II at 50 dollars each. Type the amount you wish to purchase."
    so things like that could save you with sign troubles if you had to.

    Also, just making sure, will a hashmap work with new items later on? Because we all know how much mojang loves to add new stuff all the time :p
    I know with other shops ive tried in the past, like showcase and some chest shops, they seem to use a lib file? and accept new items just fine, even some odd things from other plugins like books that are written in using the Bookworm plugin (it knows the difference between an empty book and a book that has been written in). Will a hashmap do these things?

    And, fyi, not to keen on OddItem. tried it in the past.
  27. Offline


    In the future I could add that, but right now I just want to get the basic mechanics up and running.

    To borrow an analogy from the wiki, a hashmap is like a phonebook, a list of names with a phone number for each. If you have the name you can get the phone number.
    Here's the first part of mine:
    It continues on with every item currently found in the game.
    Adding new items is as simple as creating a new line in the list.

    I use this method to get the item's name.
    I input the ID and it returns the name of the item.

    Also can someone tell me how to embed my pasties? It's driving me insane.

    Phew, SimpleSignShops v0.1 Alpha (for real this time) can be found at this link.

    This contains the absolute minimum functionality necessary to consider it a plugin.
    It also requires Vault.
    An important thing to remember is that as of yet there are NO player-owned shops. Only server shops (infinite shops), but don't worry, those and much more will be included once the plugin is finished, the only purpose for this alpha is to make sure the plugin functions on a basic level.

    Currently Ops and anyone with the permission sss.admin (if you use permissions) can create Admin Shops by placing a sign with one of the following formats:

    Admin Shop​
    Buy: <Price>​
    <Item ID>​
    To buy from this shop hit the sign, if you have enough money you will receive one of the item and the price will be deducted from your account. To buy another hit the sign again.​
    Admin Shop​
    Sell: <Price>​
    <Item ID>​
    To sell an item to this shop hit the sign, if you have at least one of the specified item in your inventory, it will be removed and the price will be added to your account. To sell another hit the sign again.​
    Admin Shop​
    Sell: <Price>​
    <Leave This Empty>
    You can sell any item to this shop, to sell an item hit the sign. You must be holding the item you wish to sell in your hand when you hit the sign. The item you are holding will be removed (if you're holding a stack only one item from the stack will be removed) and the price will be added to your account.​
    Both the sign itself and the block it's placed on have break protection. Ops and those with the sss.admin permission can close shops by aiming at the sign and typing the command /sss close. This will clear the text on the sign and remove the break protection from the sign and the block that it's on. All relevant data about that shop will be removed from the datafile.​
    Since this is alpha bug reports are extremely important, please post here about any bugs, errors, questions, or concerns. Also I'm not just talking to kalez here, this is for anyone who for any reason wants to help with the testing, the more bug reports I get the sooner this plugin will be ready for release, so any help is appreciated.​
    At some point in the near future I'll create a thread for this in either the WIP section or the Plugin Submissions forum.​

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


    Awesome! Unfortunately i will not be able to test today. I will try to get to it tomarrow.
  29. Offline


    No rush. :)
  30. Offline


    Was unable to test the plugin due to

    2012-02-16 15:57:15 [SEVERE] Could not load 'plugins/SimpleSignShops.jar' in folder 'plugins': depend is of wrong type
    org.bukkit.plugin.InvalidDescriptionException: depend is of wrong type
    at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:211)
    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:37)
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:188)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:118)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:156)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:132)
    at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)

Share This Page