[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


    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!

    • 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 will only be used if it is installed. The following is the permissions list:

    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.


    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)

    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.***

    • 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


    Edit: This breaks with the latest iConomy. I get the following:

    2011-03-01 00:48:39 [SEVERE] com/nijikokun/bukkit/iConomy/iConomy (Is it up to date?)
    java.lang.NoClassDefFoundError: com/nijikokun/bukkit/iConomy/iConomy
            at com.MatCat.NPCTrader.NPCTrader.checkiConomy(NPCTrader.java:630)
            at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:132)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:140)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:426)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:79)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:60)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: com.nijikokun.bukkit.iConomy.iConomy
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            ... 12 more
    Dunno if this has been suggested, but I would like to see a way for an NPC to execute a command when the player makes a purchase. That way I can, for example, /heal people who talk to a doctor.
  3. Offline


    any updates for the npctrader yet?
  4. Offline


    Nope, but I'm hopeing they come soon - or someone else makes something like it - cause it's the best i'd seen.
  5. Offline


    still not working even with iconomey 2.0 or 2.1 or 3.0 or 4.0 or 4.1 lol

    2011-03-01 15:37:03 [SEVERE] Could not load plugins\NPCTrader.jar in plugins: null
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:80)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:59)
        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.NoSuchMethodException: com.MatCat.NPCTrader.NPCTrader.<init>()
        at java.lang.Class.getConstructor0(Unknown Source)
        at java.lang.Class.getConstructor(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
        ... 8 more
    i miss these :(
  6. Offline


    Great idea but without SQL-Lite....Sorry =(
  7. Hmm... i've had to disable this plugin, because it is no longer compatible with ...well, anything :S As bukkit has continued upgrading, fixing some important issues, everything else updates to match... but sadly, this has been left behind. Its got great potential, and i hope that life un-busies itself for our wonderful developer :)
  8. Offline


    Signed! And my users are really hard on my back for it. This excellent plugin is greatly missed.
  9. Offline


    let's be positive about it and hope that this plugin gets either continued or the sourcecode gets handed over to someone with great skills;)
  10. Offline


    Stop bashing for SQLite. Pro's running there Server with MySQL! xD
    But an update really would be nice :/
  11. Offline


    Yeah, forget SQLite... Mysql works great :)
  12. Offline


    Update this sexy plugin.
  13. Offline

    Michael Murphy

    please update and post source on github (if possible) :)
  14. Offline


    Just downgrade your bukkit and your iconomy ! it's work for me !

    ( minecraft 1.3 )
  15. Offline


    Which version of Bukkit do you have
    And which version of iConomy ?

    And... does all of your others addons work then?

    - Volander
  16. Offline

    Michael Murphy

    I had it working on #432 i think, but when I went to use npc create, it'd fail on the sql insertion.
  17. Offline


    Is this working with 483+ and does it support Global Prices yet?
  18. Offline


    @MatCat I don't use any form of iconomy on my server and have no use for npcs as npcs but I'm wondering if there is any way to use this plugin to create statues in a structure I'm building? I would just need a player style character (with the skin of my choosing) to stand in one spot an never move. Is that possible? I have two account so if the skin has to be pulled from a player by name I could just set the smooth stone player skin for my alt and have the statues pull that skin. (don't even know if that's possible like it was back with craftizens)
  19. Offline


    doesn't works with b485 :(
  20. Offline


    Don't believe you will get any answer.
  21. Offline


    Sorry for the long delay, I have been super busy with my new job. I am going to work on an update for iConomy 4.1, switch from Permissions 2.0 to GroupManager. I am going to try to have this out today.
    Volander and mrgreaper like this.
  22. Offline


    thank you so much! can't wait to implement this onto our server
  23. Offline


    I always answer, it just might take a while
    --- merged: Mar 2, 2011 6:51 PM ---
    This is possible actually, I will pm you a special build that can be used to do it.
  24. Offline


    It's wizards like you that keep bukkit awesome. Thank you, good sir.

    Also, will it show the npc/staute's name or is that editable? would rather not have anything floating over their heads.
  25. Offline


    Oh cool, I thought this project died for a second. My server seems to want to load NPCTrader before iConomy, which you know, wouldn't work. Though I am using the latest iConomy and bukkit, so I don't think it would work anyway.
  26. Offline


    You sir have just made my decade!
    Finaly a use for iconomy!
    GroupManager also a very good call its by far the best of the present permission plugins!
  27. Offline


    It would have to show the name of the minecraft account you have the skin setup on, there is no way around it for now.
  28. Offline


    Is there any estimation time for this plugin to be renewed to work with newer iconomy and bukkit?
  29. Offline


    I am going to try to get it out sometime today.
  30. Offline


    I personally think that all plugin developers should just stop trying to support sqlite.
    MySQL is a better solution with a easier interface for correcting the database entries later (phpmyadmin) and really isn't all that hard to install now a days. Just my two cents.
  31. Offline


    MatCat, good luck! We all have been waiting for this kind of response, since this plugin is a must in a great RP server ;)

Share This Page