[INACTIVE][ECON] TradeCraft v0.7 - Chest/Gold Based Economy! [531]

Discussion in 'Inactive/Unsupported Plugins' started by mjmr89, Mar 11, 2011.

  1. Offline


    TradeCraft - Chest/Gold Based Economy
    Version: 0.7

    • Make infinite shops - place gold or items in the chest, right click the sign, and watch the magic happen!
    • Become entrepreneurs! Have a lot of extra goods? Create a shop to let people easily buy or sell!
    • Change the currency if you don't like gold
    Download and Source

    All credit for the core of this mod goes to the github user jdiamond (injektilo on the hey0 forums). All I'm doing is porting it at the moment, but I'll probably add more features down the road. I haven't been able to test it extensively so far, so expect problems! If you don't have Permissions, it will resort to only letting ops make or destroy shops, but all players can buy/sell at shops. The TradeCraft.txt and TradeCraft.properties files are IN the jar, open it up with a archive manager program and extract them to the same folder as your craftbukkit.jar. I know they should be in something like plugins/TradeCraft, and I'll change that soon.

    For the readme, please go to the source page and look there. It is also included in the jar file if you open it with an archive manager.

    • TradeCraft.canBuy
    • TradeCraft.canSell
    • TradeCraft.canMakeInfShops
    • TradeCraft.canMakePlayerShops
    • TradeCraft.canDestroyShops
    • /setCurrency - use the id number, or the material name (using _ as spaces)
    • /displayCurrency - Shows the current currency
    • /canPlayer - debugging info if there are problems with permissions - outputs to the console.
    • /myShops - displays the personal shops you have and their current inventory/gold
    To Do:
    • Repair shops? Some basic structure is in the old hmod plugin, could probably get it working without too much trouble.
    • iConomy interaction? For example, back up iConomy $$$ with gold or something? Not sure how that would work out, or if people would find it useful.
    If theres any more comments or questions, please let me know!
    kenneth123, ydido and Digi like this.
  2. Offline


    I guess you misunderstood what I meant. And now I'm not sure what you mean :).
    I assume that's in response to my
    Maybe you could print a notice for if you cannot buy or sell an item (0:0) set in config/sign.
    With that I meant that when an item in the config has a trade ratio of 0:0 and you have an infinite shop, right-clicking could perhaps say that trading of this item is disabled. The same for when only selling or buying is disabled that way. It was just a small thing I thought of.

    I guess I should have tested that myself quickly actually. I might do that later if you haven't yet.
  3. Offline


    Tested it. Using sand, which by the default .txt file sells 48:1. Put 64 sand in, sold, got 16 sand and one gold bar :)
  4. Offline


    Where are you able to get the build of 554 or later? I've just recently tried the one on the documentation link, and it is only 544. Due to this earlier build that seems to be the only available version for me, this plugin does not work for me.
  5. Offline


    Not sure what you mean. If theres confusion because I had the 554 in the topic title, I've changed that, it works on the last RB, 531. I'm also fairly sure it works on 544 because I've tested it (all but others buying from personal shops because I can't test that on my own).
  6. Offline


    By RB, I'm guessing you're meaning Recommended Build. I use the Development Snapshot which comes to my current build of 544. However, when I try to run the plugin, it displays the regular errors that appears when a plugin has an issue; Plugin: Tradecraft is null and then a whole list of errors. It creates all the tradecraft files, but refuses to run on my version.
  7. Offline


    That's odd, as I've said I have tested it on 544... Can you post the full error? Also, do you have permissions installed and, if so, the latest version? Thanks.

    BTW, You might want to consider sticking to the recommended builds, it's what developers try to make sure they support so if you're on a non recommended build, you're more likely to have problems like these.
  8. Offline


    My exact error is this.
    17:57:10 [INFO] [Permissions] version [2.5.3] (Phoenix) was Initialized.
    17:57:10 [SEVERE] Could not load plugins\TradeCraft.jar in plugins: null
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
            ... 8 more
    Caused by: java.lang.NullPointerException
            at com.mjmr89.TradeCraft.TradeCraftPropertiesFile.populate(TradeCraftPro
            at com.mjmr89.TradeCraft.TradeCraftPropertiesFile.<init>(TradeCraftPrope
            at com.mjmr89.TradeCraft.TradeCraft.<init>(TradeCraft.java:42)
            ... 13 more
    And I understand that I SHOULD switch to recommended builds, but all of my current plugins work correctly and flawlessly now, besides this, and I like having more recent builds so I am able to try out newly developed or updated plugins. And from the log, it shows that I have Permissions 2.5.3 installed. This version works correctly with all other plugins, but I do not understand where the issue lies in this plugin.
  9. Offline


    Huh, that's odd, I don't get that error :/. The method causing it shouldn't even be there anymore, it was a test that I forgot to take out. I'll get it out and get a new version in a minute.
  10. Offline


    Thank you. If you could post when it is not there, that'd be much appreciated.
  11. Offline


    Updated just now, but I integrated the download link with github, click the Downloads button on the github. Also, check out /myshops - displays the info on any personal shops you have out there (stock, gold amount).
  12. Offline


    Ok, I got it working, as in it runs. But, when I attempt to set the currency, I do not get any notifaciton, and when I try to view the currency, it says, in-game, that an internal error has occured. And, in the console, it displays this error.
    18:41:53 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'disp
    laycurrency' in plugin TradeCraft v0.5
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NullPointerException
            at com.mjmr89.TradeCraft.TradeCraft.onCommand(TradeCraft.java:117)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
  13. Offline


    That's odd (again) on mine, bukkit version 554, it works fine. I made a change that might fix the problem you're having, shouldn't hurt anything.

    Sorry you're having so much trouble with this plugin!
  14. Offline


    Yes! It's working fine now! Thank you for your help! I'll let you know if I experience any more trouble. Thanks again. :D

    Oh, and a quick question; are the rates in the TradeCraft.txt the only rates people can sell that item for? So say I said, for example, "Bread, 297, 4:1, 6:1" does that mean people can only sell it for 4 bread per 1 gold? Or can it be changed? I'm still a bit confused on this portion of the mod.

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


    For infinite shops, the buy/sell rate is constant, and fixed in the .txt. You could buy four bread for one gold, or get one gold for six bread. For personal shops, it is completely customizable - more info in the readme. Did that help answer your question?
  16. Offline


    Yes, thank you. I just wanted to make sure I didn't have to tell everyone what the rates were.
  17. Offline


    It seems you're not preventing players from removing other player's trade chests/signs. Though the last version I tried is 0.4. I'm not sure what changed with 0.5.

    Obviously ops should be able to remove such combinations (but I wonder what should happen with the items in it, in all cases actually). But trade chests at least need to be secure from griefers I guess.

    We've done some more testing and it seems that even breaking both sign and chest, the original owner can still place them back and get their items back. But I wonder whether that survives a server restart (assuming some of that stuff is just stored in the TradeCraft plugin memory?)

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


    Took a look at it and I think I might have fixed it, I'm updating it now. Now, the owner of the shop and anyone with the canDestroy permission can destroy sign or chest associated with it. If they try and destroy a chest attached to a shop, it will check, if they try to destroy the sign attached to the shop, it will check. It will only destroy the block originally destroyed (if you can), it wont get rid of both.

    Edit - I now see your second post - that sounds right, it doesn't delete the entry in the data file. I'll try to fix that soon.
  19. Hi. I installed this like an hour ago, along with Permissions. I set up administrators which can do anything, but on the other hand moderators can't destroy signs - or shouldn't be able to. But they still can.

    I saw a few minutes ago you had found this bug and corrected it - I downloaded TradeCraft.jar 0.6 from the website, replaced the old one with this new one. The problem still persists.

    I've taken everyone from the ops list, and included myself in the moderators permissions group, but I can still destroy signs and so can other mods. Is this really fixed, or am I doing something wrong? I'm including my permissions.yml file to see if I've done everything correctly...

    Edit: Oh and debugging this, using the /canplayer command, the console returns candestroy FALSE. Which makes this even weirder.
  20. Offline


    Dude! I've been waiting for this since bukkit came out!

    I missed this mod sooo much! you're my favorite person!

    Please Please Please Don't add iConnomy support, thats what made this plugin great, because it relied solely on a physical currency, that could be lost and stolen.

    @Colour'd wools - thats a good idea, when this plugin was originally out there where no colour'd wools, hence the lack of a mention.
  21. Offline


    Alright, I was an idiot :D It happens, too much... I've been trying to fix the destroying signs/chests issue with absolutely no luck, then noticed I hadn't added the block break event :/. NOW it should be fixed. If you destroy a shop piece (either sign or chest) and you cant (don't have permissions, aren't the owner, or the shop has stuff in it - the SHOP, not the chest!), it might disappear for a second, but it should reappear shortly. Signs will also keep their original text when that happens. If you CAN destroy a chest, it will be gone for good. If you could help me out in making sure, try /myshops before you destroy your own personal shop, then destroy it, then make sure it disappeared by using /myshops again. Thanks!

    Wools - a to-do I meant to add on the OP after it was suggested, still a to-do. Not quite sure how I'd go about that though. I know the notation for things like /give or /item is the wool id number, then ;, then the data value - but that might be difficult because of how the original author recognized item exchange rates and stuff on signs. I'll definitely look into it though!
  22. It happens, I know programming can be a pain in the ass. I'm way too tired now so I'll test it out tomorrow and let you know if it works.
  23. Offline


    Thanks mjmr89, that seems to have done it!

    I just had a thought for a path a griefer might take. Which would be by using Craftbook/Minecart Mania or other chest 'exchange' plugins to access the chest in an automated way. But are the items even actually still in the chest once placed there (and followed by clicked on the sign) by a trader (player owned chest/shop)?

    Oh hah, one issue..
    One can destroy the block behind the sign, resulting in the sign to be removed automatically.

    Have fun fixing that! :)

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


    Add iConomy buying support and this is perfect! [​IMG]
  25. Offline


    Put 1 Gold in Box Get $100 of iconomy (Example)
    Buy for 1:100
    Sell for 1:1

    doing this will make people get money and use money with other plugins, if this was possible it would be great

    [Bug Report]
    /myshop spelling mistake, Item: LOG Amount:22Gold: 3
    .................................................................................^^(no space)
    also i can't add beds for some reason

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


    This works fine for CB 493. Can someone make a default TradeCraft.txt just for items with item ID? I'm too lazy to go in and add all of them so we can make playershops...
  27. Offline


    Thanks for all the input :D

    About possible griefing, you need to right click the sign for the transaction so I don't think there would be much potential for griefing - maybe you meant something I'm not catching? As for catching the block behind the sign breaking, that shouldn't be too hard to fix.

    Can't add beds huh... That's an odd one, I can't think of a reason for it off the top of my head. I'm thinking its how the items are recognized somehow. I'll look into it. Now that I think about it, it might for some reason be BED_BLOCK? That's the only thing I can think of off the top of my head, give it a try.

    As for iConomy, it's on the to do list but I'm not sure how much of a priority it is. I've had one comment against it, and another for it (yours). There are also an issue or two I see that could make it odd.

    Anyway, I'm not sure when I can get these things fixed, I think I'm going to be busy for a couple days. Luckily, it doesn't seem like any of these issues are too urgent.

    P.S. It got to the Releases section, hurray!
  28. Offline


    iConomy support, why?! I love the shops, great!

    But... where's your changelog?!
  29. Offline


    I dont get it. can i only sell items that are in the tradecraft.txt? if so does someone have one for every item?
  30. Offline


    Yes, the tradecraft.txt is needed to put names to object IDs. It also allows you your own names or abbreviations, which can be quite handy at times.
    It can take a little effort. But why not just do it yourself? For sure you don't want all possible items on the list anyway. And you might want to use your own abbreviations, for some of them.
  31. Offline


    Okay, so can i just put the id and the name? does the buy and sell thingos matter?

Share This Page