[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

    feverdream

    I dont see a link to source.. I'm at work so I cant check but is it included in the jar instead?
     
  3. Offline

    FloydATC

    Just open the .jar file using unzip (linux), WinZip/WinRar (Windows) or whatever utility you prefer. You should find the .java source files inside unless I goofed :)
     
  4. Offline

    c0mp

    Thanks for posting this, just what I've been waiting for! Having a bit of an issue, not sure if it's something I'm doing wrong, some incompatibility somewhere, or what. Using build 102, I'm not getting any kits. Here is my plugins/KitPlugin/kits.txt file:

    Code:
    armor;310 1;311 1;312 1;313 1
    tools;276 1;277 1;278 1;279 1;269 1
    rail;66 128;328 2;69 2
    aid;320 5
    chainarmor;302 1;303 1;304 1;305 1
    I have restarted the server to enable the plugin fully. No errors during startup, and I get the notification that KitPlugin version 1.0 is enabled. Typing /kit <anything>, doesn't give me the corresponding items in kits.txt. I receive no error in-game, nor is anything reported in the server log when I attempt to procure a /kit.
     
  5. Offline

    FloydATC

    Sounds like onPlayerCommand() is never called at all, this is probably an incompatibility issue. I noticed that the new ScrapBukkit source uses a completely different callback prototype that doesn't correspond with the current Bukkit source so there may be changes in the pipeline. I'll try to make sense of it and then post an update.
     
  6. Offline

    cian1500ww

    Also not getting anything when typing /kit in game. I'm using the latest development build CraftBukkit.
     
  7. Offline

    FloydATC

    I think I've finally isolated the problem, it seems if I register the commands in plugin.yml they don't work consistently. Leave them out, and everything seems ok. Please re-download and let me know if it works :)
     
  8. Offline

    c0mp

    Testing now, thanks![diamond]

    EDIT: Yay! Kits are back! Tested working with build 126 and the above-posted kits.txt. Again, thank you for releasing this!
     
  9. Offline

    Hessian

    Looks like a useful plugin, but could there be a way that each username can only claim the kit once?
     
  10. Offline

    FloydATC

    When I get around to it, I will add an optional cooldown timer like in hMod.
     
  11. Offline

    FuUzZiioN_GaMer

    Where i must creat the .txt ?
     
  12. Offline

    FloydATC

    The .jar file goes in your "plugins" directory,
    The .txt file goes in a new "plugins/KitPlugin/" directory you must create yourself.
    This is common for most (if not all) Bukkit plugins. I have tested this under Win7 and Linux but if you get it wrong, you should see a FileNotFound exception showing you where the plugin expected to find the file. Let me know if there's anything that need to be fixed.
     
  13. Offline

    Threezool

    Could i maybe request a restriction for kits for groups?

    Like one kit for admins with armor and tools and editing items that other users cant be able to get? =)

    Only for users would work to.
     
  14. Offline

    Mercury

    Is it possible to give out permissions for players?
    Code:
    # Name;ID Amount;ID Amount;ID amount (etc);Player
    Diamondkit;268 1;269 1;Merc
     
  15. Offline

    FloydATC

    Actually, I thought I'd use Permissions, like kit.starterkit, kit.diamondkit and kit.* as soon as I can wrap my head around how to make KitPlugin permissions-aware. Nijikokun's example code doesn't seem to be fool-proof enough to sink in with me.

    I finally got it. Download the newest version and test it please :)
     
  16. Offline

    Duccis

    Hey there!

    Really like the smallness in this and that it work with Permissions plugin,
    but it's missing out a timer (delay). Would be great to have this feature.

    Edit: Oh, and btw, the plugin doesn't generate the kits.txt in \plugins\KitPlugin\ automatically.
     
  17. Offline

    SliMeY_G

    I have the following in my Permissions (v1.9) config.yml:

    Code:
    groups:
        Default:
            default: true
            info:
                prefix:
                suffix:
                build: true
            inheritance:
            permissions:
                - 'general.spawn'
                - 'kit.*'
    
    This, however, doesn't seem to be allowing default users to run /kit commands. Am I doing something wrong or is there a problem somewhere?

    Running:
    - craftbukkit build #131
    - Permissions v1.9
    - General v2.0

    Appreciate any help whatsoever!
     
  18. Offline

    FloydATC

    This seems to be an issue with Permissions, I don't know if it's intentional or not but 'kit.*' does not implicitly allow 'kit'.

    For this reason, you need to grant 'kit' to anyone who should be allowed to use the kit command at all (i.e. to know about its existence) and then either add explicit permissions for each kit or use 'kit.*' to grant access to all kits. I'm hoping this will change in the future.
     
  19. Offline

    SliMeY_G

    Adding the following now works:
    Code:
    permissions:
        - 'kit'
        - 'kit.*'
    From the way I understand it with other plugins, the way they implement their stuff in the Permissions config is in the format of

    <plugin name>.<command>

    hence the reason why I only had 'kit.*'. I know you said you were new to Java, and while not being a Java programmer myself, I do stuff in other languages and maybe it's worth going through the source of other plugins that use Permissions to see how they've implemented it so that we can use something like 'kit.*' to allow use of ANY command in this plugin or something like the following to explicitly allow only certain kits:
    Code:
    permissions:
        - kit.kit
        - kit.kit.starter
        - kit.kit.tools

    Just a suggestion, but am now a very happy man! Thankyou very much for the help!
     
  20. Offline

    FloydATC

    'kit.kit' hurts my brain... :eek:

    I could make it optional though; if either 'kit' or 'kit.kit' is permitted then the command could be accessible. This would be transparent in the sense that 'kit.*' would just DWYM and 'kit' would do what it says on the tin.

    Making the change tonight, stay tuned... (I'm on CET and have to deal with work and family first) Done.
     
  21. Offline

    folke94

    can some 1 send me abdone config whit kits named:
    armor
    tools
    rail
    aid
    chainarmor
    plzz cant understand any thing
     
  22. Offline

    FloydATC

    It's pretty much the same as it used to be in hMod really, just use a list of item IDs:
    Code:
    armor;306 1;307 1;308 1;309 1
    tools;256 1;257 1;258 1
    rail;66 64
    aid;50 64;260 1
    chainarmor;302 1;303 1;304 1;305 1
    If you wanted to add a ~5 minute timer to the 'armor' kit you would change it to
    Code:
    armor;306 1;307 1;308 1;309 1;-6000
    Hope this helps.
     
  23. Offline

    Tott3

    Using this on my server, thanks a bunch for your effort <3
     
  24. Offline

    th3saget

    Sooo this is the last plugin i need to get working! I can not figure it out. When I type /kits I see the kits. but when I try to get a kit it does nothing. http://i.imgur.com/2gvWo.png that is my server error messge.


    groups:
    Default:
    default: true
    info:
    prefix:
    suffix:
    build: true
    inheritance:
    permissions:
    - 'general.spawn'
    Moderator:
    default: false
    info:
    prefix:
    suffix:
    build: true
    inheritance:
    - Default
    permissions:
    - 'general.time'
    - 'general.teleport'
    - 'general.teleport.here'
    - 'general.player-info'
    - 'MagicCarpet'
    - 'kit.*'
    - 'kit.kit'
    - 'MyWarp'
    Admins:
    default: false
    info:
    prefix:
    suffix:
    build: true
    inheritance:
    - Moderator
    permissions:
    - '*'

    ##
    # DarkGrave has control over all commands.
    # sk89q can use /spawn & /time
    ##
    users:
    th3saget:
    group: Admins
    permissions:
    - 'kit.*'
    - 'kit'
    whitegoodman:
    group: Admins
    permissions:
    - 'kit.*'
    - 'kit'
    zminey:
    group: Admins
    permissions:
    - 'kit.*'
    - 'kit'


    that is my permissions file. I dont know if it matters but I am using McMyAdmin. and the other plugins work. thanks for any help guys!
     
  25. Offline

    atristoffate

    Is there anyway to /kit (kit) (player)?
     
  26. Offline

    Queepo

    Waiting for certain kits per group support, looks great keep up the good work.
     
  27. Offline

    FloydATC

    The NumberFormatException suggests that there may be a problem with 'kits.txt', remember that the plugin wants item IDs and won't accept names (yet). Please post your 'kits.txt' if you still can't find the problem.

    This is controlled via permissions. For the relevant group, add permission to 'kit.<name of the kit>'. In such a setup, only ops/admins would get access to 'kit.*'.
     
  28. Offline

    Queepo

    I should have read more carefully downloading now thanks for your help.
     
  29. Offline

    FloydATC

    No but that's a good idea.
     
  30. Offline

    th3saget

     

    Attached Files:

    • kits.txt
      File size:
      147 bytes
      Views:
      109

Share This Page