[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

    The world map is based on Google API, it generates every 1 hour using c10t map renderer.
     
  3. Offline

    Kitzur

    Ok, I´m use Permision 2.55 on cb 617 .
    My next error:

    2011-04-11 05:03:00 [SEVERE] null loading iConomy v4.65 (Is it up to date?) java.util.ConcurrentModificationException at java.util.TreeMap$PrivateEntryIterator.nextEntry(Unknown Source) at java.util.TreeMap$KeyIterator.next(Unknown Source) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:253) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:515) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216) at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72) at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215) at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202) at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257) at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
     
  4. Offline

    Zenergyx3

    I use Permissions 2.6. GroupManager hasn't been updated in a while.
     
  5. Offline

    Germata

    I only use permissions and have no group manager and fake permissions running. That shouldnt be the problem.
     
  6. Offline

    Kazeron

    I have been using this plug and it worked fine, I have been setting up a new server wich is running on bukket 670 and this pulg doesn't work on it, it kicks back error on '/npc create BlahBlah 8 10' are there plans to update this to run on bukkit 670?
     
  7. Offline

    Windwaker

    Hmmm for some reason, the config file doesn't seem to be generating on 617...

    Sample?

    Ooops nm Ill just extract it from the jar :D

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

    Kitzur

    My new error on cb 617:

    2011-04-13 20:31:46 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPlayerCommandPreprocess has been replaced with a new signature, (PlayerCommandPreprocessEvent) 2011-04-13 20:31:46 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'npc' in plugin NPCTrader v1.1.2 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:233) at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:594) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:557) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:551) at net.minecraft.server.Packet3Chat.a(SourceFile:24) at net.minecraft.server.NetworkManager.a(NetworkManager.java:198) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72) at net.minecraft.server.NetworkListenThread.a(SourceFile:100) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283) at net.minecraft.server.ThreadServerApplication.run(SourceFile:375) Caused by: java.lang.NoSuchMethodError: com.nijiko.permissions.PermissionHandler.getGroup(Ljava/lang/String;)Ljava/lang/String; at com.MatCat.NPCTrader.NPCTrader.CanCreate(NPCTrader.java:118) at com.MatCat.NPCTrader.Commands.npcCreateCommand.Run(npcCreateCommand.java:42) at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:354) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35) ... 12 more
     
  9. Offline

    Plague

    Do not use a plus sing in your version tag, you cannot guarantee that for future updates.
     
  10. Offline

    Delodien

    I get this error at the moment:
    Code:
    SEVERE] java.sql.SQLException: Column 'WorldName' not found.
    2011-04-13 22:23:04 [SEVERE]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    2011-04-13 22:23:04 [SEVERE]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
    2011-04-13 22:23:04 [SEVERE]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
    2011-04-13 22:23:04 [SEVERE]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
    2011-04-13 22:23:04 [SEVERE]     at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1144)
    2011-04-13 22:23:04 [SEVERE]     at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5616)
    2011-04-13 22:23:04 [SEVERE]     at com.MatCat.NPCTrader.NPCTraderMySQL.SetupNPC(NPCTraderMySQL.java:1000)
    2011-04-13 22:23:04 [SEVERE]     at com.MatCat.NPCTrader.NPCTrader.onEnable(NPCTrader.java:254)
    2011-04-13 22:23:04 [SEVERE]     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    2011-04-13 22:23:04 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:514)
    2011-04-13 22:23:04 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
    2011-04-13 22:23:04 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
    2011-04-13 22:23:04 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
    2011-04-13 22:23:04 [SEVERE]     at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
    2011-04-13 22:23:04 [SEVERE]     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
    2011-04-13 22:23:04 [SEVERE]     at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
    2011-04-13 22:23:04 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
    2011-04-13 22:23:04 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    2011-04-13 22:23:04 [INFO] NPCTrader version 1.1.2 is enabled!
    I know its a SQL error, but I'm not sure where, the login details are fine but it doesn't seem to be creating any tables in the database.
     
  11. 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!
    (Auto-generates config.yml in plugins/NPCTrader/) does not work
    I using CB 617.
    Please give me folder NPCTrader with and file config.yml

    Thanks
     
    GingernutRanger likes this.
  12. Offline

    Zenergyx3

    Can you like, read the thread?
     
  13. Offline

    GingernutRanger

    Just make your own NPCTrader Folder then restart your server :) It will make a config.yml inside it
     
  14. Offline

    Avous

    question... can this use a chest or does it take it from the players inventory?
     
  15. Offline

    GingernutRanger

    Ok ive tried everything!
    Code:
    16:24:55 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPla
    yerCommandPreprocess has been replaced with a new signature, (PlayerCommandPrepr
    ocessEvent)
    16:25:12 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'npc'
     in plugin NPCTrader v1.1.2
            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
    54)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.NoSuchMethodError: com.nijiko.permissions.PermissionHandler
    .getGroup(Ljava/lang/String;)Ljava/lang/String;
            at com.MatCat.NPCTrader.NPCTrader.CanCreate(NPCTrader.java:118)
            at com.MatCat.NPCTrader.Commands.npcCreateCommand.Run(npcCreateCommand.j
    ava:42)
            at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:354)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
     
  16. :)
    I know.

    After restart server (Auto-generates config.yml in plugins/NPCTrader/) does not work.

    Please send me folder NPCtrader with config.yml
     
  17. Offline

    Avous

    could someone please tell me if it takes the stuff out of you inventory or a chest? or does it just spawn the stuff on the merchant?
     
  18. Offline

    Stahlbrand

    You Stock the NPC. The npc is the chest. You buy Item Slots and inventory slots for that specific item you are selling. Each slot can hold a stack or only one depending on if it is stackable.

    To my Own Question:
    Love the mod it works great except one thing. Me and my other Admin are testing to see if we can delete each others NPC trader in case someone puts one is a really dumb place or gets banned, or even move it for them. However we cant. We both have permissions set to *. So we should have access to any trader, but we don't.
    Is there a command I am missing?
     
  19. Offline

    Plague

    Since the header says 612 (the plus sign is not allowed so I have not taken it into account) this is considered an unsupported plugin.

    I did post earlier about the plus sign. When the plugin is updated, just report the original post or tag/reply me.
     
  20. Offline

    Stahlbrand

    Umm I had wrong version DUH. Lol Its working now thanks
     
  21. Offline

    Kryxx

    I get this same error.
    CB 670
     
  22. Offline

    GingernutRanger

    Ive managed to fix it but, you have to delete permissions or fakepermissions :(
     
  23. Offline

    woodzy

    please get back on the plugin list my players just LOVE THIS PLUGIN and this
    2011-04-15 15:25:27 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPlayerCommandPreprocess has been replaced with a new signature, (PlayerCommandPreprocessEvent)
     
    GingernutRanger likes this.
  24. Offline

    DioZero

    is there any way to make an 'fake' account for the money the shop needs to sell?
     
  25. Offline

    woodzy

    nope it needs iconomy
     
  26. Offline

    DioZero

    i do have iconomy xP but i made some shops that all people can acces to, but i don't want other people to make shops xP the only problem is i need a lot of money so people can sell stuff to it and that make me unable to 'play' to xS but i think i've found something xD
     
  27. Offline

    woodzy

    as for the dont make shops dont give them the permisson node as for thay need money try Uquest :D we have it LOVE IT login to my server to see it for ur self
     
  28. Offline

    GingernutRanger

    Anyone managed to get this working with permissions? I'm still having a problem...
     
  29. Offline

    MatCat

    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 
    Assuming you have it setup where members can create their own NPC's you would give your normal member group:
    - npc.user.*
    - npc.manager.*
    - npc.owner.*
    - npc.create

    You would give your admin / mod group:
    - npc.admin.list
    - npc.admin

    It's pretty simple, if you only want mods/admin to make npc's, then give your mod/admin groups npc.create and not your members. If you only want admins to have access but let members buy/sell give the admin group npc.* and regular members npc.user.*

    Why is this inactive?!

    That is a bit ridiculous, you know full well it is still compatible with the current rb...

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

    GingernutRanger

    Ok thanks matcat i will do exactly as this says

    Everything works except whenever i try to make a new npc it says Internal Error Occured and the same stuff appears in the command window. My permissions are as follows:
    Code:
    plugin:
        permissions:
            system: default
            copies: null
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance: null
            permissions:
            - myhome.home.basic.home
            - myhome.home.basic.set
            - myhome.home.basic.delete
            - iConomyChestShop.shop.create
            - iConomyChestShop.shop.buy
            - iConomyChestShop.shop.sell
            - wolfnames.set
            - wolfnames.show
            - signtrader.MakeGlobalSign
            - signtrader.MakePersonalSign
            - signtrader.Use
            - mywarp.warp.basic.warp
            - mywarp.warp.sign.warp
            - residence.create
            - stargate.use
            - stargate.free.use
            - npc.user.*
            - npc.manager.*
            - npc.owner.*
            - npc.create
        Moderator:
            default: false
            info:
                prefix: '&a'
                suffix: ''
                build: true
            inheritance:
            - Default
            permissions:
            - mywarp.*
            - stargate.create
            - stargate.private
            - stargate.hidden
            - stargate.option.private
            - stargate.option.free
            - npc.admin.list
            - npc.admin
        Builders:
            default: false
            info:
                prefix: '&9'
                suffix: ''
                build: true
            inheritance:
            - Default
            permissions: null
        Admins:
            default: false
            info:
                prefix: '&c'
                suffix: ''
                build: true
            inheritance:
            - Moderator
            permissions:
            - '*'
            - residence.admin
    users:
        themightyhenley:
            group: Builders
            permissions: null
        sewsews:
            group: Moderator
            info:
                prefix: null
                suffix: null
            permissions: null
        GingernutRanger:
            group: Admins
            permissions: null
    
    What is wrong?

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

    Kitzur

    My error(670)

    2011-04-16 18:18:02 [SEVERE] Nag author: 'MatCat' of 'NPCTrader' about the following: onPlayerCommandPreprocess has been replaced with a new signature, (PlayerCommandPreprocessEvent) 2011-04-16 18:18:02 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'npc' in plugin NPCTrader v1.1.2 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:254) at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553) at net.minecraft.server.Packet3Chat.a(SourceFile:24) at net.minecraft.server.NetworkManager.a(NetworkManager.java:198) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72) at net.minecraft.server.NetworkListenThread.a(SourceFile:100) at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283) at net.minecraft.server.ThreadServerApplication.run(SourceFile:375) Caused by: java.lang.NoSuchMethodError: com.nijiko.permissions.PermissionHandler.getGroup(Ljava/lang/String;)Ljava/lang/String; at com.MatCat.NPCTrader.NPCTrader.CanCreate(NPCTrader.java:118) at com.MatCat.NPCTrader.Commands.npcCreateCommand.Run(npcCreateCommand.java:42) at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:354) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35) ... 12 more
     

Share This Page