[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

    _frozen

    Just wanted to throw in a few words of support- even though I'm not using it atm (using Iconomy5) but once this is released I WILL be using this. Keep up the great work!
     
  3. Offline

    phoenixstar

    I'd love to start using this! Finally have enough people on my server to warrant using it. :D
    i am testing it with iconomy 5 but im guessing theres some issues still since bukkit is only what 2 days out now? Just fyi we still support you!! Keep up the hard work! cant wait for the update! :D
     
  4. When can I expect a Permissions supporting version to appear?
     
  5. Offline

    tombik

    Hi, I'm having this bug .. do i have to create something? :/

    2011-06-03 23:50:07 [WARNING] [Authorization] SQL Exception happend: 2011-06-03 23:50:07 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mc41.authorize_users' doesn't exist 2011-06-03 23:50:07 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2011-06-03 23:50:07 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 2011-06-03 23:50:07 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 2011-06-03 23:50:07 [SEVERE] at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.Util.getInstance(Util.java:382) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111) 2011-06-03 23:50:07 [SEVERE] at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2273) 2011-06-03 23:50:07 [SEVERE] at ru.greencubes.auth.Authorize.onEnable(Authorize.java:197) 2011-06-03 23:50:07 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125) 2011-06-03 23:50:07 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750) 2011-06-03 23:50:07 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253) 2011-06-03 23:50:07 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:134) 2011-06-03 23:50:07 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:112) 2011-06-03 23:50:07 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232) 2011-06-03 23:50:07 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219) 2011-06-03 23:50:07 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146) 2011-06-03 23:50:07 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285) 2011-06-03 23:50:07 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:422) 2011-06-03 23:50:07 [WARNING] [Authorization] Authorization plugin won't work!
     
  6. Offline

    Riolu

    It's so hemorrhoid to install this plugin :confused: I give up!
     
  7. Offline

    Afforess

    @MatCat

    Just wanted to let you know, BukkitContrib now supports custom skins/cloaks/user titles in it's API.
     
  8. Offline

    Wakko

    Using CB b818
    Code:
    2011-06-07 03:05:34 [SEVERE] Could not pass event PLUGIN_ENABLE to NPCTrader
    java.lang.NoClassDefFoundError: com/nijiko/coelho/iConomy/iConomy
        at com.MatCat.NPCTrader.PluginListener.onPluginEnable(PluginListener.java:24)
        at org.bukkit.plugin.java.JavaPluginLoader$37.execute(JavaPluginLoader.java:497)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:757)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:134)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:112)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassNotFoundException: com.nijiko.coelho.iConomy.iConomy
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 13 more
    My console gets the above error upon starting.
    Then it's spammed with the error below every few lines or so. (Also while it's starting.)
    Code:
    2011-06-07 03:05:34 [SEVERE] Could not pass event PLUGIN_ENABLE to NPCTrader
    java.lang.NoClassDefFoundError: com/nijiko/coelho/iConomy/iConomy
        at com.MatCat.NPCTrader.PluginListener.onPluginEnable(PluginListener.java:24)
        at org.bukkit.plugin.java.JavaPluginLoader$37.execute(JavaPluginLoader.java:497)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:757)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:134)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:112)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    iConomy is updated, I fixed the MySQL info, I'm not sure what else I need to do.
     
  9. Offline

    DaddyCool64

    NPC Trader don't work with iConomy 5 yet
     
  10. Offline

    Wakko

    Yah, that would be nice.
     
  11. Offline

    dady000

    Is this compatible with version 1.6.6?
    I tried all versions of iConomy 4.0+.

    It write me errors when I would create new npc and when I created npc and wrote me error, I restarted server
    and wrote me error in console :

    Code:
    2011-06-10 16:32:50 [SEVERE] Error occurred while enabling NPCTrader v1.1.4 (Is it up to date?): net.minecraft.server.ItemInWorldManager.<init>(Lnet/minecraft/server/World;)V
    
    java.lang.NoSuchMethodError: net.minecraft.server.ItemInWorldManager.<init>(Lnet/minecraft/server/WorldV
    
    at com.MatCat.NPCLib.NpcSpawner.SpawnBasicHumanNpc(NpcSpawner.java:77)
    
    at com.MatCat.NPCTrader.NPCTraderMySQL.SetupNPC(NPCTraderMySQL.java:1050)
    
    at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:269)
    
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
    
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
    
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
    
    at com.MatCat.NPCTrader.NPCTrader.ensureEnabled(NPCTrader.java:105)
    
    at com.MatCat.NPCTrader.PluginListener.onPluginEnable(PluginListener.java:27)
    
    at org.bukkit.plugin.java.JavaPluginLoader$37.execute(JavaPluginLoader.java:497)
    
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:757)
    
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
    
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:134)
    
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:112)
    
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
    
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
    
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
    
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    If it is not updated, please update it in short time :).
     
  12. Offline

    DaddyCool64

    @MatCat
    can you give us a status update, please.
     
  13. Offline

    Jaxkr

    LOL. You started writing as if you were writing Java."if, else...". But I do like the idea, but why couldn't you just use Lockette to lock the chests in the storage room?

    The source IS released. Just use an unarchiver to extract the .jar file. Then use a Java Decompiler (Google it) to convert the individual .class files into editable .java files. You will need a Java compiler/workspace such as Eclipse.

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

    Michael Murphy

    I don't think the source was out in February :p
     
  15. Offline

    VeryInsane

    Running latest Bukkit, is this stable? It'll work with newest minecraft... right? Any plugins that will conflict? Thanks for any help :)
     
  16. Offline

    Jaxkr

    If the .jar was out, the source was out. Notch never released the source for Minecraft, but people still manage to mod it. But that doesn't matter, what changes will you make to this plugin for your RP server?
     
  17. Offline

    Michael Murphy

    While I appreciate you taking the time to explain that it is still possible, this is wasting recent posting space for more recent issues people may be experiencing, causing the thread to become even more cluttered. I don't understand why any of this is relevant, it's from February, about the time of 1.3 or 1.4, so I'm not really worried about it anymore; I've already started working on my own plugins. I'm not asking the developer to release the source, at the time I was afraid he wasn't going to update it anymore.
     
  18. Offline

    Deatlev

    An internal error occured while attempting to perform this command...
    I am using Permissions, thought it would work, it does? I dunno what is causing this...CB 860 iConomy 4.6
    Commands I use to make that error occur: /npc create and /npc setup haven't tried any more

    edit: I have installed it correctly


    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.
    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)
    extra:
    You know(now?) have a fully setup and functioning NPC.

    help? -.-

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

    iSushi

    I think I meant... At that time, roleplay function of this plugin. I forgot. Theif and guard sorta stuff :) And thank you, I am flattered.
    I have never touched Java but I really love programming in general.
     
  20. Offline

    Deatlev

    Are you friggen serious??? days have past, still no answer!!
     
  21. Offline

    Deatlev

    Abandoned ???
     
  22. Offline

    Wakko

    Let's face it, this is inactive.
    Shame, would have been pretty cool for shops. :/
    (If you're still there though, please bring this back.)
     
  23. Offline

    raoulio

    This happend when I typed: /npc create 'name' 1 10
    Am I doing something wrong?
     
  24. Offline

    Wakko

    this isn't updated for iconomy or the last few recommended builds
     
  25. Offline

    Damacdaddy

    I cant find the config.yml. Any Ideas as to where it is at?
     
  26. Offline

    Sikshot_Ftw

    When i do /npc create Bob 6 10 and it does nothing why?
     
  27. Offline

    rakiru

    Outdated plugin.
     

Share This Page