[ECON] NPCTrader v1.1.4 - The Full featured localized shop system [RB740 - 766]

Discussion in 'Inactive/Unsupported Plugins' started by MatCat, Feb 13, 2011.

  1. Offline

    MatCat

    NPC Trader - The Full featured localized shop system

    Version 1.1.4 (Testing Version!)



    The first localized full featured shop system for Bukkit/iConomy, in NPC Form!

    What's better for a localized shop system then your very own NPC Clerk / Teller / Worker / Slave / Whatever word you want to call your NPC!

    Features
    • Localized system
    • Fully player controlled (No admin intervention needed)
    • Full Item and Metadata support (Colored wools, etc)
    • Item name or ID recognition
    • Partial name recognition (If online)
    • Complete internal permissions system for managers of the NPC
    • iConomy Based
    • MySQL data storage
    • Item stocking system
    • In-Game help for everything
    • Supports Permissions and GroupManager (Using FakePermissions) Plugins!
    Installation / Setup

    1. Put NPCTrader.jar in your plugins folder
    2. Put mysql-connector-java-bin.jar in your main minecraft folder
    3. Restart your server (Auto-generates config.yml in plugins/NPCTrader/)
    4. Edit the config.yml for MySQL and other config settings.
    5. Restart once more
    6. Enjoy!
    If for some reason the folder / config does not auto-generate, then you can open the .jar file with 7zip or winzip or other archiving utility that supports jars and extract the config.yml from the jar.


    NOTE: If you do not have or do not know if you have MySQL setup then you either have to setup MySQL or not use this plugin for now. Please do not post questions asking how to install MySQL as that is outside of the scope of this post. You can follow this tutorial (Thanks @Germata!) for detailed windows installation and setup, but I cannot provide support for installing and setting up MySQL, only support for my plugin specifically.

    Permissions

    Permissions will only be used if it is installed. The following is the permissions list:

    Code:
    npc.admin      - Give to admins for full access to all NPCs
    npc.admin.list - Access to /npc list npcs
    npc.user.*     - General user commands, you can specify by replacing * with command name, I.E. buy
    npc.manager.*  - NPC Manager commands
    npc.owner.*    - NPC Owner commands
    npc.create     - Ability to create an NPC 
    If permissions is used you may also specify limits on how many NPCs a specific player or group may have ownership flag on, please see config file for more information.

    Usage

    Once the plugin is installed and running, you can see the in-game help by typing /npc in your chat window. To interact with an NPC just right click on it first.

    Here is a simple tutorial for setting up an NPC named Bob that sell's bread, cooked fish, and cooked pork, and buys wheat, raw fish, and raw pork.

    1. Stand exactly where you want your NPC, including head position and body rotation.
    2. Type: /npc create Bob 6 10 This will create the NPC with 6 Item Slots, each holding 10 units.
    3. Right click on the newly created NPC
    4. Type: /npc setup 1 bread 1 2 0 true false This will setup Slot 1 with Bread, selling lots of 1 at 2 Coins, buying them from players at 0, True for NPC Selling it, False for buying from players.
    5. Repeat step 4 for Cooked fish and Pork
    6. Type: /npc setup 4 wheat 64 0 10 false true This will setup Slot 4 with Wheat, buying lots of 64 at 10 Coins. This one is set False to selling it to players, but true to buy from players.
    7. Type: /npc stock 1 20 This will stock the NPC with 20 breads on slot 1 (Assuming you have enough bread).
    8. Repeat step 7 for raw fish and pork.
    You know have a fully setup and functioning NPC.


    Known Issues / Bugs

    • Config folder does not get generated on Linux - Works on Windows
    • Cookies and beds, and pretty much any other 1.4/1.5 items.
    • Spams console when you stand close to an NPC
    • Gives error when an NPC is spawned (Can be ignored)
    • Head / Rotation is not being properly set on spawn / move. (Fixed in 1.14)
    • Does not work with actual permissions (works with GroupManager)
    • Rename command is broken
    Things Todo

    • Re-write item handling
    • Support for both GroupManager and Permissions
    • iConomy 5 Support
    • Add armor capacity
    • Tie into WorldGuard for checking for build rights (Will be optional)
    Misc


    If you installed MySQL for Windows just to run this plugin then check out this link to see how to create the initial minecraft database you will need.


    *** NOTE: SQLite IS NEVER GONNA HAPPEN! If you want to see an alternative, fork the src, make it work as an option, and I will include it in.***

    Changelog
    • Version 1.1.4
      • Changed out item name / id handling system
      • Now supports all current official items
      • Fixed Move Bug
      • Fixed NPC Creation Errors
      • Fixed a few other errors
      • Fixed Config creation on linux (hopefully!)
    • Version 1.1.3
      • Completely rewrote most of the code that directly interfaces with the NPC Library.
      • Now uses chunk loading/unloading to make sure only NPC's in loaded chunks are loaded (Way more efficient)
      • Changed banker command to only allow setting yourself as banker (to stop an exploit situation).
    • Version 1.1.2
      • Fixed upgrading stack counts for free bug
      • Fixed rename command not working on linux
      • Made it so an NPC must have 1 item slot to be created
      • Added permissions support for owned npc limits (By group or player)
    • Version 1.1.1
      • Fixed issues with quantities of '0'
      • Added rename command
      • Fixed iConomy hooking on startup
    • Version 1.1.0
      • Fixed Admin Override Permissions not working
      • Added Half and Double Slabs
      • Updated to work with B612+
    • Version 1.0.9
      • Updated to work on B531+
      • Updated to work with iConomy 4.*
      • Much needed overhaul of error handling and disabling procedures.
      • Converted integer based money to decimal based.
    • Version 1.0.8
      • Updated for newer builds
    • Version 1.0.7
      • Fixed more issues with ItemData, hopefully they are fixed for good.
      • Added log names
      • Added Coal/Charcoal distinction
      • Order of slots listed will always be in ascending order
    • Version 1.0.6
      • More meta-data issues, resolved.
    • Version 1.0.5
      • My restructuring of the code to try to support SQlite completely foobared the connect and close code, causing timeouts and errors. Fixed it.
    • Version 1.0.3
      • Fixed buy/sell/stock/unstock to use absolute values so that negatives cannot happen.
    • Version 1.0.2
      • Fixed bug where db connection was closed on /npc create
    • Version 1.0.1
      • Fixed bug with null Item Datas
    • Version 1.0.0
      • Fixed many many bugs
      • Added /npc list npcs as an admin command to let you see a full list of NPCs
      • Added recording transactions.
      • Added full permissions support
      • Better error handling and message delivery.
    • Version 0.94
      • Fixed not checking stock when doing /npc setup
      • Made the setup's error messages way more intuitive
    • Version 0.93
      • Fixed disappearing NPC bug.
    • Version 0.92
      • Fixed bug where selling was not checking player inventory.
    • Version 0.91
      • Fixed bug where giving improper arguments for upgrading and creating reported iConomy and NPC Trader out of sync.
    • Version 0.9
      • Initial Release
    You can download the jar here.



    You can download the mysql connector jar here.
     
  2. Offline

    Volander

    No, it's not.
     
  3. Offline

    mordar

    distress
    I would like to know if you know a similar plugin but in 1.3 beta?
     
  4. Offline

    MatCat

    Sorry guys, I got a new job right after 1.0.8 came out so I have been so busy, I promised it a few days ago but I just haven't had time. This plugin is by no means inactive. I am going to get a 531 compatible version out today or tomorrow.

    Just bear with me as I am very busy, but I am working on a project that I will revolutionize the operations of a minecraft server, but more on then when the time is right...

    I am looking at the source right now actually, I promise you guys a 531 compatible plugin by tomorrow at the latest.
     
  5. Offline

    DJHenjin

    Thank you matcat for Updating us on your situation. Will be looking forward to the updated build. I will be more than happy to test it for you.
     
  6. Offline

    korin125

    Excited for the update. Hopefully it comes soon!
     
  7. Offline

    DJHenjin

    i talked to MatCat briefly a short while ago, He tells me that if it isnt out tonight theres a 90% chance it will be out tomorrow, and apologizes for the delays
     
  8. Offline

    David McCahon

    Soooo its a few days since you said tomorrow... any word on when new version will be out? and the build should be 556 not 531 thats old
     
  9. Offline

    Volander

    @MadCat, not to be rude or anything - we love your plugin - but if you can't have it done by the deadline you set yourself. Don't promise it.

    It makes us go... wtf? No addon - but you promised.

    Better to just say - hey guys, I'm pretty busy - but still working at it.

    I, personally, would rather have a message from you on this thread from time to time with progress, instead of a deadline that dosen't hold up.

    - Volander
     
  10. Offline

    qrux

    Word.
     
  11. Offline

    MatCat

    Sorry guys you are right, I have a bad habit of promise early deliver later :p, working on that... BUT the good news is I am actually working on it right now. I am about 30 min from a test build, maybe 1 hour to release.

    This release will utilize iConomy 4, Permissions and GroupManager (Via FakePermissions, will update to full GroupManager support soon unless anyone asks me to keep it this way).

    Because of iConomy now supporting decimals, NPCTrader will as well.

    I am building and testing this on Build 531, should still work on 556, if not I will do a 556 compatible build after 531 build is up.

    So sorry for the delays and broken promises, from here on out I will just leave it as I am extremely busy, but will attend to this plugin as best I can and keep updates between breaks and fixes.

    I am also working on 2 other major Minecraft projects, the one I believe will revolutionize servers as much as bukkit is. The other I hope will also capture the majority of the Minecraft playerbase, but more on that later...
     
  12. Offline

    David McCahon

    Well come on now atleast tell us what your revolutionary plugins will do.... not to beg or anything but you are amazing.... PLZ?
     
  13. Offline

    MatCat

    One project is a website that I am developing. It will be a complete Minecraft community. Opening features will be Forums, Social System, Server List (More feature rich then current ones), Minecraft related news and info. Bere in mind that this is only my opening phase, there is a lot more that will go on that site to make it quite awesome. Just keep in mind the concept is for social based system, that will have features well beyond what just forums can offer.

    My second project is is web and plugin based. I do not want to go into very much detail about it quite yet, but this is the one I believe will revolutionize the Minecraft server as we know it at the moment :). It is also the project I would much rather be working on, but realistically I need the community website up first to be able to properly support the project, as it will host the project once I am ready to fully announce it.

    Ok guys, Back to NPC Trader, converting from old iConomy to new iConomy is taking a little longer then expected because of all the changes from integer numbers to decimal numbers, but I am nearly done with it. Should be released fairly soon.

    If anyone is interested in doing in any real intense testing, I could put up a debug and testing build soon... But I wont bother if there isn't much of a response by the time I am testing it.
     
  14. Offline

    David McCahon

    Wow sounds like you have a lot of good work cut out for you, but i can test the trader plugin as it would be a good test on my server as I have 30+ plugins running. So hit me up if I could test that for you.

    Thanks for your amazing work
     
  15. Offline

    MatCat

    Actually, while I am on the thought of it...

    I am looking for one plugin developer whom is well versed in Java and the Bukkit API, whoom is interested in working on a fairly large project, and has the time to do so.

    I am also looking for a good PHP programmer for the project.

    Anyone interested must have enough time to actively help develop, and document as we develop.

    If interested please PM me, and we can discuss it further.

    Awesome, once I have a test build I will post a link to you. Should be soon, I need to stop posting on here and get back on it :p.

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

    David McCahon

    haha thanks im around to help anytime... except the coding part as I am in entry level classes on programming C++ and Java, but soon enough i hope to get a start on some projects

    any progress on the test build?

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

    MatCat

    I got it to build and run, however I am having permissions issues and I noticed NPCs didn't seem to load up until the invisibility checker flagged it... So still some stuff to iron out before test build, but soon.
     
  18. Offline

    David McCahon

    Alright sounds good, haha this is great because i have a few of the guys all happy about this and its killing them to test it out :)
     
  19. Offline

    MatCat

    Blammo, a little teaser!
    Still have some small bugs to work out before test build though...

    2011-03-25_19.49.29.png
     
  20. Offline

    David McCahon

    Looks Great!!!!

    Hows the bug squashin goin for ya?

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

    MatCat

    Had to take a dinner break
     
  22. Offline

    David McCahon

    Haha well that is reasonable, i forgot to ask but if i have a MySQL database will your plugin generate any values it needs
     
  23. Offline

    MatCat

    Well you do NEED a MySQL Database, the update will work fine regardless if you have used the plugin or not, and if you have before it will continue working fine with your old data.

    I am doing a quick test of my new build now, boss came in and I had to work on other stuffs for a little bit.

    OH yeah, you do have to edit your config.yml file of course to specify the database details :)

    Experimental build is up, Version 1.0.9! I did some brief tests, but if anyone else wants to give it a try! I built it and tested against CB 531, Please let me know if its working on 556, and consequently if it does what the highest build it works on up to.

    If you find any bugs please report.

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

    Kitzur

    This Plugin ist disable on CB 542 or higher
     
  25. Offline

    MatCat

    Can you give details? It seems to be working fine for me on 531.
     
  26. Offline

    Kitzur

    OK
    This is my Plugin Error:
    2011-03-26 16:05:27 [SEVERE] java.io.IOException: No such file or directory
    2011-03-26 16:05:27 [SEVERE] at java.io.UnixFileSystem.createFileExclusively(Native Method)
    2011-03-26 16:05:27 [SEVERE] at java.io.File.createNewFile(Unknown Source)
    2011-03-26 16:05:27 [SEVERE] at com.MatCat.NPCTrader.Resources.writeResource(Resources.java:10)
    2011-03-26 16:05:27 [SEVERE] at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:158)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:85)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:63)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:253)
    2011-03-26 16:05:27 [SEVERE] at com.earth2me.essentials.commands.Commandreloadall.run(Commandreloadall.java:27)
    2011-03-26 16:05:27 [SEVERE] at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:45)
    2011-03-26 16:05:27 [SEVERE] at com.earth2me.essentials.Essentials.onCommand(Essentials.java:587)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    2011-03-26 16:05:27 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:222)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.NetworkManager.a(SourceFile:230)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    2011-03-26 16:05:27 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-03-26 16:05:27 [INFO] Database configuration Error!
    Verify your config.yml settings are correct and valid for your MySQL setup.
    Returned Error: java.lang.NullPointerException


    so the Plugin ist disabled!

    I have CB 542
     
  27. Offline

    Kegan187

    How do I get iConomy to load before NPCTrader? Thanks.

    @Kitzur I had the same issue, open the NPCTrader.jar file with winrar and extract the config.yml. Then make a folder in you plugins folder named NPCTrader and put the file in that. Then configure it to your liking.

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

    Kitzur

    ok wait

    EDIT: IST WORKS thx
     
  29. Offline

    MatCat

    Re-download the jar, Fixed it to work even if iConomy loads afterwards.

    Those file errors are odd, could be a permissions issue with your plugins folder...

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

    Kegan187

    The new jar causes a problem with iConomy 4.5
    Code:
    19:23:30 [SEVERE] null loading iConomy v4.5 (Is it up to date?)
    java.util.ConcurrentModificationException
            at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1117)
            at java.util.TreeMap$KeyIterator.next(TreeMap.java:1171)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:253)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:452)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
            at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:205)
            at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:196)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:183)
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:381)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:366)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
    I used 4.5 before and it didn't get this error.
     
  31. Offline

    MatCat

    Yeah I am having same thing with 4.5, trying to figure it out.
     

Share This Page