[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

    denace

    Code:
    2011-02-24 16:11:13 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'npc' in plugin NPCTrader v1.0.8
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:21)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:173)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:633)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:596)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:590)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NoSuchFieldError: db
        at com.MatCat.NPCTrader.Commands.npcCreateCommand.Run(npcCreateCommand.java:41)
        at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:286)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:19)
        ... 12 more
    
    I get this error when i try to create a NPC. MySQL Settings are right. Before the update i used 0.94 and it worked fine with the same options and MySQL too.

    Im runnin CB 430. Please help.
     
  3. Offline

    contex

    MatCat, can you at least tell us if this is fixable (comming in a new version)?
     
  4. Offline

    lamnea

    Help me out here?

    Driver: "com.mysql.jdbc.Driver"
    Database: "jdbc:mysql://localhost:3256/kunden?57687"
    what am i supposed to put here>??

    some iformation i have-

    (in the php admin shiz it says localhost:3256)
    Host: mysql.xenonservers.com
    Database Name: kunden_57687
    Database User: kunden_5768

    i made a database called kunden?57687
     
  5. Offline

    MinehubGaming

    Could you also please provide a time frame in your changelog? Makes it easier when seeing how recent the current plugin build is.
     
  6. Offline

    mrgreaper

    does this support recomanded build 432 and iconomey 3.0 ?
     
  7. Offline

    crohakon

    So, the MySQL error was caused by a change in the config for NPCTrader. I generated a new one and it loads. NPCs are in game, but no commands for it work. It echos this "An internal error occured while attempting to perform this command" in the client and this in the console....

    Code:
    2011-02-24 19:13:38 [SEVERE] Could not pass event ENTITY_TARGET to NPCTrader
    java.lang.NullPointerException
        at com.MatCat.NPCTrader.Commands.npcCommand.Run(npcCommand.java:76)
        at com.MatCat.NPCTrader.Commands.npcListCommand.Run(npcListCommand.java:20)
        at com.MatCat.NPCTrader.NPCTraderEntityListener.onEntityTarget(NPCTraderEntityListener.java:74)
        at org.bukkit.plugin.java.JavaPluginLoader$44.execute(JavaPluginLoader.java:354)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:225)
        at redecouverte.npcspawner.CHumanNpc.a(CHumanNpc.java:43)
        at net.minecraft.server.EntityHuman.c(EntityHuman.java:397)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:745)
        at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
     
  8. Offline

    inphinitii

    Upon creating an NPC, I'm getting an error saying..
    'An internal error occurred while attempting to perform this command'.
    The exact command I used was

    '/npc create Bob 10 6'.
     
  9. Offline

    3nkao

    +1 For the NPC Creation problems :(
     
  10. Offline

    crohakon

    Are you going to continue developing this plug-in in light of Niji's decision to stop production on iConomy? If so, please let us know so that can seek out alternatives.
     
  11. Offline

    sumTard

    iConomy is not being abandoned, check the thread. And this works just fine for me on CB432
     
  12. Offline

    SSA

    3.0 has been released already, and other devs are continuing from the looks of it, iConomy will never die!
     
  13. Offline

    contex

    Not working with iConomy 3.0, NPC Trader 1.0.8 and b443
     
  14. Offline

    denace

    Does this plugin need iConomy 3.0?
     
  15. Offline

    redf1sh

    Still no luck with iConomy 3.0 and b432 here.[​IMG]

    Are you able to create new npcs or is it just that npcs that were already there are continuing to work?
     
  16. Offline

    contex

    I think I know what could be wrong, I'm getting the same error with multiworld (it required Permissions 2.0 and not 2.1), and I am running 2.1.

    And Madcat, if you're not planning to give us updates why not just give us the source so we can fix this ourselves?
     
  17. Offline

    Samylots

    When this plugin will be updated ?
     
  18. Offline

    sumTard

    I still use the previous iConomy and I can create and use npcs just fine.
     
  19. Offline

    redf1sh

    Hmm I wonder what the hell I'm doing wrong, no luck with iConomy 2.0 or 3.0.
     
  20. Offline

    contex

    Are you using permissions 2.1?
     
  21. Offline

    redf1sh

    Hmm possibly, though I think it was 2.0. I'll have to check when I'm off work.
     
  22. Offline

    Thegoodguy

    Same problem :(
     
  23. Offline

    Runelynx

    Is this ready for Iconomy 3.0 ?

    This stops other plugins from working whether I use Iconomy 2.0 or 3.0...
    Using permissions 2.0

    My users are going nuts to get this back, pls can we have an update :(
     
  24. Offline

    Volander

    Code:
    09:14:01 [INFO] Starting minecraft server version Beta 1.3
    09:14:01 [INFO] Loading properties
    09:14:01 [INFO] Starting Minecraft server on *:25565
    09:14:01 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-468-
    ga3bf56c-b450jnks (MC: 1.3)
    09:14:01 [INFO] Preparing level "world"
    09:14:01 [INFO] Preparing start region
    09:14:02 [INFO] Preparing spawn area: 81%
    09:14:03 [INFO] LWC    [v1,56] Loading shared objects
    09:14:03 [INFO] Config  [v1,56] Loaded 12 config entries
    09:14:03 [INFO] LWC    [v1,56] Native library: lib/native/Windows/amd64/sqlitej
    dbc.dll
    09:14:03 [SEVERE] Could not load plugins\NPCTrader.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava: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.j
    ava:75)
            ... 8 more
    09:14:03 [INFO] WorldGuard loaded.
    With NPCTrader v1.0.8 [b421+] i get this error at startup.
     
  25. Offline

    Carnage104

    I agree
     
  26. Offline

    RazorX

    Code:
    2011-02-26 20:21:04 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'npc' in plugin NPCTrader v1.0.8
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:21)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:176)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:638)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:601)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:595)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NoSuchMethodError: com.nijikokun.bukkit.iConomy.Database.get_balance(Ljava/lang/String;)I
        at com.MatCat.NPCTrader.Commands.npcCreateCommand.Run(npcCreateCommand.java:41)
        at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:286)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:19)
        ... 12 more
    Help me Please :[

    try this
    Driver: "com.mysql.jdbc.Driver"
    Database: "jdbc:mysql://mysql.xenonservers.com:3256/kunden_57687"

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

    lamnea

    Worked like a charm! thanks dude :) although not with this plugin seems to be dead?
     
  28. Offline

    Samylots

    I got the same error :

    Code:
    13:45:56 [GRAVE] Could not load plugins\NPCTrader.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava: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.j
    ava:75)
            ... 8 more
    I'm on CraftBukkit 452 ...
     
  29. Offline

    mrgreaper

    the developer was last seen yesterday 17:56 so i assume its not a dead project unless he has abandoned it

    I hope not any way as there is nothing remotly similier to this. but then with the iconemy plugin developer only supporting a permission plugin he has abandoned then its all kinda up in the air at mo
     
  30. Offline

    lamnea

    hmm that sucks. makes me miss hmod even more! is there any plugin that will give me a non player character in game>?
     
  31. Offline

    denace

    I like bukkit. The only thing thats sucks is that MatCat doesnt give any response. Me and the players on my server built a city with shops, where npcs selling their stuff.
    I deactivated the npcs and said to my players, that i dont know if there will be any update for them.

    MatCat, are you still workin on this?
     

Share This Page