[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

    FloydATC

    See, this is why I've only released the simplest of my plugins :-/
    --- merged: Feb 19, 2011 1:58 PM ---
    OK new version posted, v1.08. There are quite a few changes in this release:

    1. Very slightly improved error-checking. All it really does is watch out for an exception while parsing each kit definition and if it crashes point out that it crashed while parsing that line and therefore something appears to be wrong right there. There's really no way I can predict all the different weird stuff ppl can put in there so all I can do is point you in the right direction.

    2. If "plugins/KitPlugin/kits.txt" does not exist then it is now created automatically. If this fails, you should get a meaningfull error message from your operating system.

    3. The plugin has been changed to use the recommended onCommand() callback instead of the deprecated onPlayerCommand() callback. This is for compatibility with Fill.

    4. KitPlugin has been moved out of the Bukkit namespace as requested by the Bukkit team. This change should be completely transparent to users and admins.
     
  3. Offline

    seriosbrad

    Does this plugin auto-reload itself if the kit.txt has been altered? If not, can you implement a /kit reload function?

    I hate having to restart my server to reload a config file.
     
  4. Offline

    FloydATC

    Good point, no it doesn't. I'll give it a shot.

    Update: v1.09 posted. "/kit reload" requires access to "kit.reload". Note that this is a quick hack, if two admins reload at exactly the same time then it's theoretically possible that kits will appear twice. Also, if a player is requesting a kit at the exact same time he may get an error message. I may decide to add locking later if this turns out to be a real issue.
     
  5. Offline

    calkhi

    my minecraft crashes after i, the admin, request a kit. it seems almost as if bukkit and permissions are conflicting. even when i op myself it still crashes, iv enterd everything thats required but do i have to change something in the permissions file?(minecraft program, not the server crashes) any advice?
     
  6. Offline

    seriosbrad

    Thanks for the update dude!
     
  7. Offline

    calkhi

    nvrm, fixed it!
     
  8. Offline

    FloydATC

    Good :) Out of general interest, what was the problem?
     
  9. Offline

    pagangeek

    Thanks for this plugin!
    One suggestion though:

    A little bit of clarification regarding the extreme lack of whitespace sensitivity would have been nice... a single errant space in my config file eluded me for the last 15 minutes as I tried to to figure out why Kits would be named, but not dispense... and then suddenly not exist at all..
     
  10. Offline

    FloydATC

    I'll try to improve the error messages so it gets easier to narrow down the search to the particular line fragment that upsets the plugin so much.
     
  11. Offline

    Xemnas33

    This requires an update to work with the latest Craftbukkit version. I can't remember the error since I dwongraded but it's something about tidying up code. Best tot test it because almost every plugin ahs this error and it's painful. Also petitionplugin has it too.
     
  12. Offline

    FloydATC

    Looking into it now. It seems even the sample plugin suffers from this and I don't really understand what they want me to do... here's the exact message you are seeing:
    Update: Just posted a fixed version. This is, as you say, a harmless warning so the update is not strictly necessary.
     
  13. Offline

    Xemnas33

    Yep that's it, almost every plugin will give the error on server startup which is really annoying. Best bit is it tells you who to go nag xD
     
  14. Offline

    calkhi

    well, it seems as though i had entered the sets wrong :p
     
  15. Offline

    Srulis

    Hi,
    When i luanch it says kit disabled, no permissions, can anyone tell me how to fix it.
    See screen cap...[​IMG]
     
  16. Offline

    jlhbaseball15

    hi i've been trying to load the plugin but i get
    "SEVERE: Could not load plugins\KitPlugin.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:79)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:117)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:82)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:53)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
    at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.NoSuchMethodException: com.floyd.bukkit.kit.KitPlugin.<init
    >(org.bukkit.plugin.PluginLoader, org.bukkit.Server, org.bukkit.plugin.PluginDes
    criptionFile, java.io.File, java.io.File, java.lang.ClassLoader)
    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"
    every time I try to load it. the plugins I am currently using besides kit plugin are worldedit, simplehome, simpleprotect, guardian, general, teleplus, permissions, and mywarp. Any ideas????
     
  17. Offline

    FloydATC

    Are you using the Permissions plugin?
    --- merged: Feb 22, 2011 2:28 PM ---
    The only thing I can think of is that the plugin interface changed in a recent version of Bukkit so you may have to update to a slightly newer Craftbukkit. Keeping track of build numbers and all the changes is a pain... If you get the warning messages about "stupidly long constructor" you should be well on your way, this came at roughly the same time as the API change.
     
  18. Offline

    TheUnseen

    The plugin doesn't seem to work anymore,whenever I enter /kit or /kit 'whatever kit I need' It just says /kit [<kit>].This only happened since the new version of craft bukkit and the 1.10v of this plugin came out,before that it worked perfectly.PLEASE HELP!!!!!
     
  19. Offline

    FloydATC

    This looks like a permission problem, have you granted access to the individual kits as explained in the OP? I have just tested v1.10 against Jenkins#432, which is a recommended build.

    Update: There's a compatibility problem with Permissions 2.1, I'm looking into it.
     
  20. Offline

    TheUnseen

    Thanks a mil!!!!!!!! I will keep my eye on this then!!!!!
     
  21. Offline

    monir

    how do write in permissions so all user can use kit?
    groups:
    Default:
    default: true
    info:
    prefix:
    suffix:
    build: true
    inheritance:
    permissions:
    - 'general.spawn'
    - 'general.teleport'
    - 'general.teleport.here'
    - 'general.player-info'
    - 'myhome.home.*'
     
  22. Offline

    FloydATC

    OK here's the thing. This is indeed an issue with the permissions. The issue is simply that Permissions 2.1 now supports multiple worlds. These are the update instructions:

    Do this, and most of your plugins should once again start behaving like expected.
     
  23. Offline

    El_Coyote

    Would it be possible to use - 'kit.*' in permissions as opposed to having to add every kit on a line of it's own?

    Also I've had to add all the kits under every user, since they for some reason doesn't work for me when they're added to the groups. - it just results in the /kit [<kit>] "error".

    I'm not tempted to tinker more with the settings since to took long enough to make kits working on all the users i've had chance to test with. It's kind of tedious work due to the amount of kits I've got configured.
     
  24. Offline

    shadydeath999

    canu u also add a option that a kit can only be aqquired one time by a player
     
  25. Offline

    monir

    it only work for admins when we write kit but cant make it work for the players on the server
    and we changed please-rename-me.yml to our world name what am i doing wrong?
    they get the message you dont have acess to any kits..
     
  26. Offline

    FloydATC

    This is handled by the Permissions plugin and already possible. I do this myself.

    Have you updated to Permissions 2.1? I got this error with Permissions 2.0 after updating CB to build #432

    Just add a ridiculously long cooldown timer, like -999999. I'd think twice about this though.

    I really can't say... all I do is call the Permissions API checking for access to kit.kit and kit.<name of kit>, it Permissions is denying this then you have to debug your YML file(s). Btw keep in mind that you need to duplicate the YML for each world if you have more than one.

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

    Mr Jimi

    Any time I put any command starting with "/kit," I get "/kit [<kit>]" as output. I have the latest plugin version and Permissions 2.1. My kit.txt is the example with some added kits (which shouldn't disallow me from seeing the example kits). Please help.
     
  28. Offline

    dubca7

    I don't know how the example is, but this is how I have it and it works.
    Code:
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'kit.*'
     
  29. Offline

    Mr Jimi

    Forgive me if I am wrong, but I gathered from the (poorly devised) directions on Permissions that if i put -'*' for the permissions, all commands should be usable. I only have Permissions because other plugins require it; this server is just for me and my sister. Still, reading the other comments, it seems I should get a message saying I don't have the required permissions. Still, not knowing what to do I gave it a try, alas, my situation is the same :(

    I guess it isn't that important, but it would be nice to hit /kit rock and get 5 stacks of cobble instead of getting it one stack at a time with /give
     
  30. Offline

    FloydATC

    You are correct, granting '*' should give you access to any and all commands. If you recently upgraded to Permissions 2.1 however, notice that you rename its config file from "config" to the name of your world.

    Just so you know, the /give command accepts an optional amount parameter, e.g. /give rock 1024

    Ofcourse, /kit rock is still faster to type :)
     
  31. Offline

    rbos

    hey, support for block metadata would be nice, having a kit with multiple cloth colours and all.
     

Share This Page