[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

    MatCat

    Do you have permissions setup for it? What happens when you type /npc? Anything show in the server console?

    I will ask the developer of Citizens what they are doing to fix it...

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

    woodzy

    yes i have permissons setup and the nodes have been added, i have had my server for some time now. when i type /npc nothing no errors nothing
     
  4. Offline

    MatCat

    Could you post a copy of your entire startup log?
     
  5. Offline

    swedish2011

    thanks.
    when do you think you want to finish it? :p
     
  6. Offline

    MatCat

    Well I asked the developer of Citizens and they know nothing of it, and honestly I do not know anything about it either.
     
  7. Offline

    swedish2011

    ok thanks anyway

    612 CB ? pls

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

    Rilly

    How do I get NPCTrader to load AFTER iConomy?

    Code:
    2011-04-01 20:04:31 [INFO] NPCTrader version 1.0.9: No iConomy, disabling plugin
    2011-04-01 20:04:31 [INFO] NPCTrader version 1.0.9 is disabled!
    2011-04-01 20:04:31 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPluginEnable has been replaced with a new signature, (PluginEnableEvent)
    2011-04-01 20:04:31 [INFO] [iConomy] Logging is currently disabled.
    2011-04-01 20:04:31 [INFO] [iConomy] v4.63 (Kenzi) loaded.
    2011-04-01 20:04:31 [INFO] [iConomy] Developed by: [Nijikokun, Coelho]
    2011-04-01 20:04:31 [INFO] [Permissions] version [2.5.5] (Phoenix)  loaded
    2011-04-01 20:04:31 [INFO] [iConomy] hooked into Permissions.
    
    Using 617 bukkit
     
  9. Offline

    MatCat

    I am working on the plugin right now, first I am going to update with features and fixes I have been meaning to do, and release it for 556 then I will make an update for 612.
     
  10. Offline

    woodzy

    update please for 1.4 CB#617+
     
  11. Offline

    Ivian

  12. Offline

    woodzy

    any idea when ull be ready for 1.4 CB#617+? i cant wait!! and can u make it reload safe?
     
  13. Offline

    MatCat

    Updated for b612+. Let me know if you run into any problems.
     
  14. Offline

    midknight

    I'm getting the following with CB 617 + NPCTrader 1.1.0

     
  15. Offline

    Luzius

    Delete the NPCTrader.jar (not the NPCTrader folder) and redownload it.

    This works for me. (Seems Craftbukkit loads the Plugins in downloadorder (Filedate maybe))
     
  16. Offline

    MatCat

    Hrm I thought I changed onPluginEnable... Well I will try to fix that by tomorrow night.
     
  17. Offline

    Alf999111

    2011-04-04 14:27:53 [INFO] NPCTrader version 1.1.0: No iConomy, disabling plugin
    2011-04-04 14:27:53 [INFO] NPCTrader version 1.1.0 is disabled!
    2011-04-04 14:27:53 [INFO] [iConomy] Logging enabled.
    2011-04-04 14:27:53 [INFO] [iConomy] v4.65 (Kenzi) loaded.
    2011-04-04 14:27:53 [INFO] [iConomy] Developed by: [Nijikokun, Coelho]
    2011-04-04 14:27:53 [INFO] LocalShops: Attached to iConomy.
    2011-04-04 14:27:53 [INFO] [iConomy] hooked into Permissions.
     
  18. Offline

    MatCat

    Yeah for some reason my listener for iConomy stopped working, however what you can do is just /plugin enable NPCTrader once your server is started, I am going to fix this later today.
     
  19. Offline

    lunieboy

    any chance of some source code for people whos plugin didnt generate the plugins\NPCtrader folder
     
  20. Offline

    MatCat

    I really don't know why it stopped working, it's code I never changed, but I am going to look into it for next update which should be later today. But you can get the config.yml by opening the jar with any archiving program that supports it.
     
  21. Offline

    rakiru

    I've wanted to use this for a while, but it's just not possible for me. I understand that you had a lot of problems with SQLite, but I also don't use iConomy. Is there any chance you could support BOSEconomy too, or put the source on github so someone can fork it?
     
  22. Offline

    lunieboy

    thanks i will be looking foward to this and will the update be compatable with CB617
     
  23. Offline

    Ivian

    I'm using the version for 612 on 617. Works fine for me.
     
  24. Offline

    lunieboy

    by the way works with build 617 but i do get this 16:43:34
    [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPlu
    ginEnable has been replaced with a new signature, (PluginEnableEvent)

    and it dont generate the config files

    and are you able to make the command like /npct as i have clashes with another npc plugin

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

    _andy

    I had the same issue with the config file not being generated on 612+. All you need to do is manually create the NPCTrader folder in your plugins directory and it'll generate it after a restart. Hope that helps!
     
  26. Offline

    Rilly

    I've updated to 1.1, but still it loads before iConomy. How can I correct this?

    CONSOLE: NPCTrader version 1.1.0: No iConomy, disabling plugin
    CONSOLE: NPCTrader version 1.1.0 is disabled!
    iConomy: Logging is currently disabled.
    iConomy: v4.63 (Kenzi) loaded.
    iConomy: Developed by: [Nijikokun, Coelho]
     
  27. Offline

    Kitzur

    My error: (CB 612)
    2011-04-05 16:57:08 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPluginEnable has been replaced with a new signature, (PluginEnableEvent)

    EDIT: MY NEWER ERROR:
    2011-04-05 18:03:30 [INFO] NPCTrader version 1.1.0: No iConomy, disabling plugin 2011-04-05 18:03:30 [INFO] NPCTrader version 1.1.0 is disabled! 2011-04-05 18:03:30 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPluginEnable has been replaced with a new signature, (PluginEnableEvent)
     
  28. Offline

    newyorkdaily

    having this error when using npc remove command
    Code:
    >npc remove bob
    20:06:46 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'npc'
     in plugin NPCTrader v1.1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80
    )
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
    25)
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:391)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.command.Coloured
    ConsoleSender cannot be cast to org.bukkit.entity.Player
            at com.MatCat.NPCTrader.Commands.npcCommand.Run(npcCommand.java:47)
            at com.MatCat.NPCTrader.Commands.npcOwnerCommand.Run(npcOwnerCommand.jav
    a:18)
            at com.MatCat.NPCTrader.Commands.npcRemoveCommand.Run(npcRemoveCommand.j
    ava:21)
            at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:365)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 6 more
     
  29. Offline

    IAMSRS

    Wait a min.. So I have to run mySQL in the background? So far all those plugins that I've been using uses sqlite and I do not need to run anything else other than the MC server.
    I used to run maplestorey ps so it's like that? I will need to run mysql and use mysql query to edit those stuffs?
     
  30. Offline

    MatCat

    I will have a new release out soon with fixes.
     
  31. Offline

    Sergeant

    Getting the same above errors that there's no iConomy installed even though there is. Using the command /plugin enable [whatever] doesn't do anything at all other than tell me it's an unknown console command.
     

Share This Page