[INACTIVE][MECH] KitPlugin v1.2 - Dispense kits to your players (now w/ iConomy5 support) [600-818]

Discussion in 'Inactive/Unsupported Plugins' started by FloydATC, Jan 19, 2011.

  1. Offline

    FloydATC

    This simple plugin does only one thing: It dispenses kits to players upon request, like in hMod.
    Source is included in the .jar, feel free to do whatever you want with it.

    Changelog:
    v1.00 - Initial release
    v1.01 - Rebuild (fixed onPlayerCommand issue)
    v1.02 - Implemented Permissions
    v1.03 - Rebuild, implemented cooldown timers
    v1.04 - Rebuild
    v1.06 - Changed cooldown code to use SECONDS, please update kits.txt!
    v1.07 - Time until cooldown is shown in a friendly (but inaccurate) way
    v1.08 - Improved error-checking, simplified install, use onCommand, switched namespace.
    v1.09 - Added "/kit reload" to reload the config without a server restart
    v1.10 - Removed the "stupidly long constructor" as per Bukkit team recommendation
    v1.11 - Added support for item data (yes, wool colors!) and durability. Read the thread.
    v1.12 - Added support for giving kits to other players
    v1.13 - Added an informational log message when a player with 'kit.proxy' permission bypasses a cooldown
    v1.14 - Minor changes to the permission checking and logging
    v1.15 - Added optional iConomy support and price tags
    v1.2 - Updated to support iConomy 5.0 (overhaul by Xemnas33)

    Dependencies:
    • Requires the Permission plugin (2.6 or equivalent)
    How to use:

    Show a list of available kits:
    Code:
    /kit
    Get a named kit (example):
    Code:
    /kit starterkit
    How to install:

    1. Download http://minecraft.atc.no/plugins/KitPlugin.jar
    2. Copy it to your "plugins" directory
    3. Create a file calles plugins/KitPlugin/kits.txt
    4. Describe the kits you want to dispense. For example:
    Code:
    # Name;ID Amount;ID Amount;ID amount (etc)[;-cooldown][;$price]
    Starterkit;268 1;269 1;-300
    Rock;1 256
    Wool;35:0 64;35:1 64;35:2 64;35:3 64;35:4 64;35:5 64;35:6 64;35:7 64;35:8 64;35:9 64;35:10 64;35:11 64;35:12 64;35:13 64;35:14 64;35:15 64;-3600
    
    Note that the cooldown is an optional negative integer. -300 means 300 SECONDS (5 minutes)
    ID can be just a numerical id, id:data, id::durability or id:data:durability

    Permissions:
    • 'kit' (or 'kit.kit') required to access the command itself
    • 'kit.reload' required to reload the configuration
    • 'kit.proxy' required to give kits to other players and bypasses any cooldown checks.
    • 'kit.<name of kit>' required to get a specific kit (use lowercase!)
    Example:
    Code:
            - 'kit.kit'
            - 'kit.reload'
            - 'kit.proxy'
            - 'kit.starterkit'
            - 'kit.tools'
            - 'kit.*'
    
    I'm a Java newbie, please be gentle.
    Thank you :)
     
  2. Offline

    louis zook

    This interfers with Essentials for bukkit.. any way to change the command from Kit to Kits?
     
  3. Offline

    FloydATC

    Just disable the kit command i Essentials and they should play fine together.
     
  4. Offline

    zlt

    Before we go through all that trouble - does commandbook and it's kit plugin interfere with yours? That is my concern.
     
  5. Offline

    louis zook

    I am unsure of how to disable essentials kits. i tried disabling the command but it blocks everything.
     
  6. Offline

    Xemnas33

    Yes, you'll need to customise commandbook and remove the kit feature. Commandbook does not currently have kit cooldowns afaik too.
     
  7. Offline

    zlt

    Okay, thanks for the answer. Now to figure out how to cut that crap out :D
    Hehe, the cmdbook kit plugin doesn't want to give people the same amount every time, - it does support cooldown but not iconomy. Your plugin is awesome though!
     
  8. Offline

    Garrick

    Well it doesnt give me a cool down. It just keeps giving me the kit. There is no cool down time...
     
  9. Offline

    Moe041991

    I dont know why, but my user still cant use it. [kit] permission denied.

    But they do have correct permission nodes.
    hmmm

    tested with permissions 2.7.4 and permissions 2.7

    Now its working fine.
    But ones neither get charged money, nor it the cooldown working :/
     
  10. Offline

    Xemnas33

    If you were using my build please re-download I screwed up a permission sorry :(
     
  11. Offline

    Moe041991

    now it works, but i have differen problems now:
    one is neither getting charged money, nor is the cooldown working :/
     
  12. Offline

    Xemnas33

    Hm interesting just to make sure can you try the build in the OP please? That way i'll know it's something i've done :)
     
  13. Offline

    Moe041991

    s
    ame problem with OPs build.
    I prolly messed something up.

    thats my kits.txt
    Code:
     # Name;ID Amount;ID Amount;ID amount (etc)[;-cooldown]
    Starterkit;270 1;269 1;271 1;287 1;-3000;$500
    
     
  14. Offline

    Xemnas33

    Actually nevermind. I think I see what's wrong.

    1) Does the kit user have * permissions?
    2) Try this:
    Code:
     Starterkit;270 1;269 1;271 1;287 1;-3000 1;$500 
     
  15. Offline

    Moe041991

    1) no, its:
    Code:
                 - 'kit'
                - 'kit.kit'
                - 'kit.starterkit'
    For some reason, i need all 3 of them in order to make /kit available.

    2) I did. Now cooldown is working. However, charging still isnt.
     
  16. Offline

    Xemnas33

    It Should only require - 'kit.kit' and 'kit.starterkit' i've tested it as I just got my server working and your config works fine for me.

    What iConomy version are you using?
     
  17. Offline

    Moe041991

  18. Offline

    Xemnas33

    Righty all I can ask for then is for you to post a list of your plugins, permissions and the full kits.txt.
     
  19. Offline

    Moe041991

    Permissions:
    Show Spoiler

    Code:
    # System is no longer used, but may become used in the future
    # Copies is for multiple-world support
    #   Put the name of the world you wish for it to be a clone of, otherwise leave it empty.
    #   If this file is for your default world (the one in server.properties) then you must
    #   leave copies blank.
    #  Example: copies: Derp    -  This will clone the permissions of the world Derp
    #
    # Make sure to rename this file to the name of the world that is in sever.properties under
    # level-name.  So if it is level-name: world  then this should be world.yml and in the
    # plugins/Permissions directory (ie. plugins/Permissions/world.yml)
    #
    # NOTE: Do not use tabs while editing this document.  Use only spaces.  A good way to avoid
    # doing this is to use Notepad++ and replace the tab with 4 spaces.
    plugin:
        permissions:
            system: default
            copies:
    
    ##
    # AntiBuild is included with this.  To disable a group from being able to build then
    # set the build: flag to false (build: false).  If you want a group to be able to build
    # then set it to true.
    ##
    # Groups can contain inheritance.
    #   To make a group inherit the permissions from another
    #   group simply place the groups name in the "inheritance:" like so:
    #
    #   Example:
    #       inheritance:
    #           - Default
    ##
    #   All permissions including the asterisks must be placed in single quotes.
    #   like so:
    #
    #       - 'foo.bar'
    #
    #   Otherwise errors will happen!
    ##
    #   Globalized Permission settings:
    #
    #       If a permission contains periods (.) you can denote a globalized parameter:
    #
    #           - 'foo.*'
    #
    #       This will allow you to use all general commands.
    #
    ##
    #   Single Asterisk denotes all commands:
    #
    #       - '*'
    #   If you give a group this permissions, do not have the group inherit any permissions
    #   from other groups.  Any users assigned to this group should NOT be given any additional
    #   permissions either.
    ##
    #   To exempt a node use the - prefix like so:
    #       - '-foo.bar'
    ##
    #   prefix: and suffix: do not do anything on their own.  You need another outside plugin
    #   such as iChat or HeroChat in order for these to do anything.
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'lc.level.*'
                - 'residence.create'
                - 'essentials.msg'
                - 'essentials.afk'
                - 'essentials.me'
                - 'essentials.list'
                - 'localshops.user.*'
                - 'localshops.manager.*'
                - 'iConomy.access'
                - 'iConomy.payment'
                - 'iConomy.list'
                - 'residence.create'
                - 'kit.kit'
                - 'kit.starterkit'
        Moderator:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
                - Default
            permissions:
                - 'bar.foo'
        Admins:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - '*'
    
    ##
    # Users denote which users are included in which group.
    # TheNo1Yeti is in the Admin group
    # Herpina is a member of the Moderator group but also has access
    # to the herp.derp permissions
    # Derpina is a member of the admin group but does not have access
    # to the derp.derp permission node
    # Users can also have a prefix and suffix as seen with Herpina
    ##
    users:
        MuchachosC:
            group: Admins
            permissions:
        Herpina:
            group: Moderator
            info:
                prefix: 'Moo'
                suffix: 'Cow'
            permissions:
                - 'herp.derp'
        Derpina:
            group: Admins
            permissions:
                - '-derp.derp'
     

    PS: Iam not MuchachosC, Herpina, Derpina

    kits.txt:
    Show Spoiler

    Code:
    # Name;ID Amount;ID Amount;ID amount (etc)[;-cooldown][;$price]
     Starterkit;270 1;269 1;271 1;287 1;-3000 1;$500
    


    PlugIns:
    Show Spoiler

    Code:
     BorderGuard
     Essentials
     iConomy
     KitPlugin
     LevelCraft
     LocalShops
     Permissions
     Residence


    Console:
    Show Spoiler

    Code:
    2011-06-04 15:35:53 [INFO] Starting Minecraft server on 217.198.138.58:25565
    2011-06-04 15:35:53 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-766-g3fc0460-b818jnks (MC: 1.6.6)
    2011-06-04 15:35:53 [INFO] Preparing level "world"
    2011-06-04 15:35:53 [INFO] Preparing start region for level 0
    2011-06-04 15:35:53 [INFO] Preparing start region for level 1
    2011-06-04 15:35:54 [INFO] [Permissions] (Phoenix) was Initialized.
    2011-06-04 15:35:54 [INFO] [LocalShops] Loaded with 3 shop(s)
    2011-06-04 15:35:54 [INFO] [LocalShops] Version 3.1.1 is enabled: f6e356df-2770-4257-bbfa-15e4be4dc147
    2011-06-04 15:35:54 [INFO] [LocalShops] Starting NotificationThread with Timer of 300 seconds
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] BOSEconomy not found.
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] Essentials Economy found: Waiting
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] iConomy 4 not found.
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] iConomy 5 found: Waiting
    2011-06-04 15:35:54 [INFO] [LocalShops][Permission] Permissions (Phoenix) found: Waiting
    2011-06-04 15:35:54 [INFO] [LocalShops][Permission] Local Fallback Permissions found: Loaded
    2011-06-04 15:35:54 [INFO] [LC] Using Permissions.
    2011-06-04 15:35:54 [INFO] [LC] Level Forgery 0.1.2 Loaded
    2011-06-04 15:35:54 [INFO] [LC] Level WoodCutting Loaded
    2011-06-04 15:35:54 [INFO] [LC] Level Combat Loaded
    2011-06-04 15:35:54 [INFO] [LC] Level Range Loaded.
    2011-06-04 15:35:54 [INFO] [LC] Level Mining Loaded
    2011-06-04 15:35:54 [INFO] [LC] Level Farming 0.2 Loaded
    2011-06-04 15:35:54 [INFO] [LC] Using FlatFile To Store Data.
    2011-06-04 15:35:54 [INFO] [LC] LevelCraftCore 0.1.5 Loaded
    2011-06-04 15:35:54 [INFO] [LC] Loaded levels:[Farming, Range, Combat, Forgery, Mining, WoodCutting]
    2011-06-04 15:35:54 [INFO] [Kit] plugins/KitPlugin/kits.txt reloaded OK
    2011-06-04 15:35:54 [INFO] [Kit] Permission system detected. Good.
    2011-06-04 15:35:54 [INFO] KitPlugin version 1.2.1 is enabled!
    2011-06-04 15:35:54 [INFO] [Permissions] version [2.7] (Phoenix)  loaded
    2011-06-04 15:35:54 [INFO] [LocalShops][Permission] Permissions (Phoenix) hooked.
    2011-06-04 15:35:54 [INFO] Loaded Essentials build 2.2.22 by Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] Essentials Economy hooked.
    2011-06-04 15:35:54 [INFO] [Residence] Found Permissions Plugin!
    2011-06-04 15:35:54 [INFO] [Residence] Successfully linked with iConomy!
    2011-06-04 15:35:54 [INFO] [Residence] Loaded Residences...
    2011-06-04 15:35:54 [INFO] [Residence] Enabled! Version v2.1.4 by bekvon
    2011-06-04 15:35:54 [INFO] [iConomy] Logging is currently disabled.
    2011-06-04 15:35:55 [INFO] [iConomy] v5.01 (Eruanna) loaded.
    2011-06-04 15:35:55 [INFO] [iConomy] Developed by: [Nijikokun]
    2011-06-04 15:35:55 [INFO] [Essentials] Payment method found (iConomy version: 5)
    2011-06-04 15:35:55 [INFO] [LocalShops][Economy] iConomy 5 hooked.
    2011-06-04 15:35:55 [INFO] [iConomy] hooked into Permissions.
    2011-06-04 15:35:55 [INFO] Loaded EssentialsSpawn build 2.2.22 by Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology
    2011-06-04 15:35:55 [INFO] Done (0.154s)! For help, type "help" or "?"
     
  20. Offline

    Xemnas33

    Code:
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] BOSEconomy not found.
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] Essentials Economy found: Waiting
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] iConomy 4 not found.
    2011-06-04 15:35:54 [INFO] [LocalShops][Economy] iConomy 5 found: Waiting
    2011-06-04 15:35:54 [INFO] [Kit] plugins/KitPlugin/kits.txt reloaded OK
    2011-06-04 15:35:54 [INFO] [Kit] Permission system detected. Good.
    2011-06-04 15:35:54 [INFO] KitPlugin version 1.2.1 is enabled!
    
    It's not hooking into iConomy, that is your problem. If you remove essentials it probably will. I'll look at trying to get register working for the next main release of KitPlugin so it'll support more economy plugins.
     
  21. Offline

    mikecancelosi

    Hello, when trying to do a kit, it goes out of order that i set it

    Kit:Ares;50 64;276 1;261 1;259 1;322 10;345 1;278 1;271 1;331 1
    Kit given: 276 1;278 1;261 1;331 1;259 1;345 1;271 1;50 64

    I started off with arrows too, but the arrows came first, and i had like 300 of them.. Am i missing something?
     
  22. Offline

    Gratlofatic

    I have like 9 kits, but when I type '/kit' I only get one :confused:.

    I'm OP and have -* in my permissions folder. Da fuq?
     
  23. Offline

    Bjourk

    Any new info on this? I'm still having the problem.
     
  24. Offline

    Xemnas33

    All you can do is either remove essentials or ask them about it again.
     
  25. Offline

    cholo71796

    Does this replace the active item bar (I don't want my players' items to disappear!) or add the items to available inventory space?
     
  26. Offline

    ubentobox

    I am having trouble with dispensing my kit. I did nothing more then add a few items to the starterkit, which is listed below:

    Code:
    # Name;ID Amount;ID Amount;ID amount (etc)[;-cooldown]
    Starterkit;268 1;269 1;50 4;270 1;271 1;290 1;297 2;340 1;;-34560
    
    This is the crash log:

    Code:
    2011-06-15 12:38:08 [INFO] [Kit] plugins/KitPlugin/kits.txt reloaded OK
    2011-06-15 12:38:19 [INFO] [Kit] ubentobox requested kit starterkit
    2011-06-15 12:38:19 [INFO] [Kit] Giving a kit to ubentobox: Starterkit
    2011-06-15 12:38:19 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'kit' in plugin KitPlugin v1.2
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:128)
    	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:287)
    	at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:712)
    	at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:678)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:671)
    	at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    	at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NumberFormatException: For input string: ""
    	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    	at java.lang.Integer.parseInt(Integer.java:493)
    	at java.lang.Integer.parseInt(Integer.java:514)
    	at com.floyd.bukkit.kit.KitObject.ComponentId(KitObject.java:63)
    	at com.floyd.bukkit.kit.KitPlugin.onCommand(KitPlugin.java:233)
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    	... 12 more
    
     
  27. Offline

    Xemnas33


    You used double ;; :)

    Should be:
    Starterkit;268 1;269 1;50 4;270 1;271 1;290 1;297 2;340 1;-34560
     
    ubentobox likes this.
  28. Offline

    ubentobox

    ROFL thats what happens when you setup a server + website + forms + analytics + ++++ in one go... My eyes are still burning hahah! Thanks for the fresh set.
     
    RaCooN likes this.
  29. Offline

    RaCooN

    I've got a small question: I'd like all my users to have access to a kit every week which they can use once. How exactly is the cooldown stored? Is it reset on plug-in or server restart? If so, I'd like to request a small database so cooldowns are not affected with restarts! Last but not least, continue developing this plug-in! It's wonderful in it's simplicity, I like it very much! Thanks!
     
  30. Offline

    Xemnas33

    If I remember correctly the kit cooldowns are based off the system clock? May just want to double check this with a small test :)

    No problem :p
     
  31. Offline

    FloydATC

    The plugin keeps one tiny text file per player, system time is stored on a per-kit basis so cooldowns should be unaffected by server reloads and restarts. Only the contents of kits.txt are stored in memory.
     

Share This Page