[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

    ToitagL

  3. Offline

    MatCat

    Yeah I am working on a solution to the chunk issue. Should have it out in a few hours.
     
  4. Offline

    mrgreaper

    we like the look of this so much were gonna try to add mysql lol well once the disapearing npc bug is fixed
     
  5. Offline

    MatCat

    Yeah I am working on the disappearing bug, I should have it done in an hour or two.
     
  6. Offline

    mrgreaper

    cool
    i like to think ill have mysql set up by then but its not looking good only just figured out how to install it on mineos lol
     
  7. Offline

    Phantom Index

    Yeah, one of my Bank NPCs went missing. Good thing I had 4 in the same spot!

    Is it possible to set it so we can configure how much it would cost to spawn a NPC?
     
  8. Offline

    Charles Harvey

    Any idea how to add dyes to the shops... Can't seem to figure it out.
     
  9. Offline

    MatCat

    The cost follows the formula of: ((Slots * units) * UnitPrice) + (Slots * Slotprice) The slot price and unit price is in the config.yml. The default is 100 for Slot and 5 for unit, so if you create an NPC with 5 slots and 5 units it would cost: ((5 * 5) = 25 * 5) = 125 + (5 * 100) = 500 = 625

    Dyes should work the same way wool does, using : after item name/id to give the value in range of 0 to 15.

    Also Update v0.93 is out, fixed disappearing NPC issue.
     
  10. Offline

    Charles Harvey


    Hey found another bug it seems. I'm able to add things to the shop and then do setup on the same slot. If it has a quantity that will carry over to whatever item I place in its stead.
     
  11. Offline

    MatCat

    I will get right on to fixing that
     
  12. Offline

    Charles Harvey

    NP we're using it pretty heavily if you need me to test anything else out.
     
  13. Offline

    LizardLick

    [​IMG]
    Code:
    2011-02-14 21:52:29 [INFO] WorldEdit: Permissions plugin detected! Using Permiss
    ions plugin for permissions.
    2011-02-14 21:52:30 [INFO] WorldGuard 3.2.2 loaded.
    2011-02-14 21:52:30 [INFO] WorldGuard: Permissions plugin detected! Using Permis
    sions plugin for permissions.
    2011-02-14 21:52:30 [INFO] WorldGuard: Single session is enforced.
    2011-02-14 21:52:30 [INFO] WorldGuard: TNT ignition is PERMITTED.
    2011-02-14 21:52:30 [INFO] WorldGuard: Lighters are PERMITTED.
    2011-02-14 21:52:30 [INFO] WorldGuard: Lava fire is blocked.
    2011-02-14 21:52:30 [INFO] WorldGuard: All fire spread is disabled.
    Preparing spawn area for nether, 16%
    Preparing spawn area for nether, 28%
    Preparing spawn area for nether, 40%
    Preparing spawn area for nether, 53%
    Preparing spawn area for nether, 65%
    Preparing spawn area for nether, 81%
    Preparing spawn area for nether, 97%
    2011-02-14 21:52:37 [INFO] Loaded Essentials build Dev238 by Zenexer, ementalo,
    Eris, and EggRoll
    iMonster for iConomy version 1.6 is enabled!
    Permission plugin detected - you must have iMonster.User
    NPCTrader version 0.92: Found iConomy
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link fai
    lure
    
    Last packet sent to the server was 0 ms ago.
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
    074)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
            at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
            at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :282)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at com.MatCat.NPCTrader.NPCTraderMySQL.dbConnect(NPCTraderMySQL.java:106
    4)
            at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:126)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:425)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:175)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:74)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:55)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
    va:253)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
            ... 23 more
    Fatal Error on DBConnectcom.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure
    
    Last packet sent to the server was 0 ms ago.
    java.lang.NullPointerException
            at com.MatCat.NPCTrader.NPCTraderMySQL.CheckDB(NPCTraderMySQL.java:220)
            at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:129)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:425)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:175)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:74)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:55)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Database Configuration Error
    NPCTrader version 0.92 is disabled!
    java.lang.NullPointerException
            at com.MatCat.NPCTrader.NPCTraderMySQL.SetupNPC(NPCTraderMySQL.java:864)
    
            at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:133)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:425)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:175)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:74)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:55)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    NPCTrader version 0.92 is enabled!
    2011-02-14 21:52:40 [INFO] WorldEdit: Permissions plugin detected! Using Permiss
    ions plugin for permissions.
    2011-02-14 21:52:40 [INFO] WorldGuard: Permissions plugin detected! Using Permis
    sions plugin for permissions.
    2011-02-14 21:52:41 [INFO] Persistence: Found Permissions, using it for permissi
    ons.
    2011-02-14 21:52:41 [INFO] Persistence version 0.38 is enabled
    2011-02-14 21:52:41 [INFO] ProtectedDoors Using iConomy!
    2011-02-14 21:52:41 [INFO] ProtectedDoors Using Permissions!
    2011-02-14 21:52:41 [INFO] ProtectedDoors version 0.1.7 is enabled!
    2011-02-14 21:52:41 [INFO] ServerEvents version 1.3 is enabled!
    2011-02-14 21:52:41 [INFO] ServerEvents: The server is back up at Lizard!
    TravelPortals version 1.2 is enabled!
    2011-02-14 21:52:41 [INFO] Done! For help, type "help" or "?"
    138 recipes
    2011-02-14 21:53:18 [INFO] LizardLick [/5.220.92.172:51472] logged in with entit
    y id 65
    Player count: 1
    2011-02-14 21:53:32 [INFO] ServerEvents: Ooo look LizardLick is back
    2011-02-14 21:53:32 [WARNING] Can't keep up! Did the system time change, or is t
    he server overloaded?
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link fai
    lure
    
    Last packet sent to the server was 0 ms ago.
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
    074)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
            at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
            at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :282)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at com.MatCat.NPCTrader.NPCTraderMySQL.dbConnect(NPCTraderMySQL.java:106
    4)
            at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:160)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77
    )
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1
    71)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:610)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:589)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:317)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
    va:253)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
            ... 25 more
    Fatal Error on DBConnectcom.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure
    
    Last packet sent to the server was 0 ms ago.
    2011-02-14 21:53:40 [WARNING] Can't keep up! Did the system time change, or is t
    he server overloaded?
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link fai
    lure
    
    Last packet sent to the server was 0 ms ago.
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
    074)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
            at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
            at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :282)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at com.MatCat.NPCTrader.NPCTraderMySQL.dbConnect(NPCTraderMySQL.java:106
    4)
            at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:160)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77
    )
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1
    71)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:610)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:589)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:317)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
    va:253)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
            ... 25 more
    Fatal Error on DBConnectcom.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure
    
    Last packet sent to the server was 0 ms ago.
    java.lang.NullPointerException
            at com.MatCat.NPCTrader.NPCTraderMySQL.CreateNPC(NPCTraderMySQL.java:968
    )
            at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:254)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77
    )
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1
    71)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:610)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:589)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:317)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    2011-02-14 21:54:01 [WARNING] Can't keep up! Did the system time change, or is t
    he server overloaded?
    2011-02-14 21:54:14 [INFO] LizardLick lost connection: disconnect.quitting
    2011-02-14 21:54:14 [INFO] ServerEvents: oh leave then LizardLick, just like eve
    ryone else
    2011-02-14 21:54:15 [INFO] Freed 80.55572509765625 MB.
    c
    this is the error im getting
     

    Attached Files:

  14. Offline

    Charles Harvey

    I believe you need to put the mysql connector in the directory with craftbukkit.jar
     
  15. Offline

    LizardLick

    i did that look at the screen shot i uploaded
     
  16. Offline

    Charles Harvey


    Sorry to be a bother. One other thing:

    Colors for wool appear to be off. 35.1 shows as cyan in /npc list but it is actually orange.

    Thanks.
     
  17. Offline

    mrgreaper

    we created the mysql database and managed to add an npc !

    no real testing yet as waiting for the new version but love the idea and our new friend FishermanBob :)
     
  18. Offline

    MatCat

    Fixed for setup bug, please re/download!
    --- merged: Feb 14, 2011 9:25 PM ---
    This is actually because chat colors and color codes do not match wool colors. To work around this I had to assign some wools different colors. Wool:1, orange, is the only one not represented by atleast a similar color, it is linked to Cyan as that was the only free color left.

    YAY!
    --- merged: Feb 14, 2011 9:27 PM ---
    It looks like your Database: setting is wrong, paste what it is from your config.yml
     
  19. Offline

    ogichidude

    i can't see the .jar file and its most likely caused by my unzipping stuff so could someone tell me what file to change to a .jar file?
     
  20. Offline

    MatCat

    The link is the jar file, nothing needs to be unzipped.
     
  21. Offline

    maxime

    Thank's really nice =)
     
  22. Offline

    ogichidude

    well tell that to my comp. thanks for telling me cause im an idiot (derp) so i changed the .zip to jar and it works
     
  23. Offline

    FXStrato

    I seem to be getting an error as well. Does this work with the current build? 326?
     
  24. Offline

    crazyball

    Nice plugin, could you make a kind of file for translation please ?

    exemple :
    Greating = "Bonjour"
    Goodbye = "Aurevoir" ...

    Sorry i've just see the Table in database for it ;)
     
  25. Offline

    FXStrato

    I hope this gets updated for further builds. This would be really nice, but for some reason I'm still getting errors, even when going back to build 313...
     
  26. Offline

    MatCat

    I am currently running it on my server on B313 with no problems. My plugin is compatible with 326 but iConomy itself is not until nikk updates it.
    --- merged: Feb 15, 2011 2:40 AM ---
    Actually it already has configurable messages, just greeting and goodbye and a few others are not yet implemented.

    I'm actually in the process of implementing permissions and a few other things including messages. That will be the next release unless a pressing bug pops up first.
     
  27. Offline

    Quz

    I'm getting "database failure trying to add npc"

    In cmd it says "Database Configuration Error NPCtrader version 0.94 is disabled!
     
  28. Offline

    MatCat

    That means your configuration is not correct. double check your config.yml and make sure database:, user:, and pass: are correct for your MySQL.
     
  29. Offline

    Quz

    Hmm, what do i set my database, user, and pass to? :p

    I made an account at MySQL.com, is the email and pass for that the same as this user and pass i need? and how do i figure out what the database should be set to?
     
  30. Offline

    MatCat

    Whatever the database, username, and password is of your MySQL setup.
     
  31. Offline

    Quz

    Where does it tell you the database? /how do you set one up?
     

Share This Page