[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

    Stephen A.

    /kit doesn't work, /kit anythinghereevenkitnames doesn't work, even with the * permission, and the kit.* . It also broke my MobSpawn plugin somehow, it just said "An internal error occurred while performing this operation" when i try. Good plugin, but sadly never worked for me....
     
  3. Offline

    jochen1147

    how can you do that the kit can only be used once for evry other player
     
  4. Offline

    Kahl

    There should be iConomy integration to allow kits to require a price.
     
  5. Offline

    FloydATC

    No idea why this happens for you, sorry.

    Set a high cooldown. (I wouldn't recommend this from a playability point of view, what if a newbie player gets killed and loses his precious stuff?)

    I've started looking into this.
     
  6. Hey,
    I've been using your plugin for a couple weeks now and it is working great. I do have one problem however. Is it implemented to be able to reload the kits from the server console? I'm working on a web user management/permissions system where users can make their own kits on my server. The only problem is that when I try to run the reload from the console, I get this

    >kit reload
    10:07:36 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'kit'
    in plugin KitPlugin v1.1
    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
    21)
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:380)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:366)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NullPointerException
    at com.floyd.bukkit.kit.KitPlugin.onCommand(KitPlugin.java:94)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 6 more
    >

    do you have any console functionality defined?

    Thanks,
     
  7. Offline

    FloydATC

    I believe the proper technical term for this is "Oops".

    So... What better way to start the weekend, than by releasing a new version at long last? Version 1.11 finally adds support for item data and durability, although to be honest it doesn't quite seem like durability works as expected at the moment.

    Confused? Well... I'm passing the durability data to Bukkit but it doesn't seem to have any effect. This may be because of some other plugin that interferes with durability on my test server. No matter, you lot will surely find out soon enough and I'm quite sure most of you are more concerned with wool colors anyway. Play with it and see if you can figure it out, the source is included if you're feeling brave.

    So, how does this work? I have done my best to make this feature backward compatible, the config file syntax has been extended as follows:

    Code:
    # A single unit of id=1
    Name;1
    
    # 2 units of item id=1
    Name;1 2
    
    # 3 units of item id=1 with data=2
    Name;1:2 3
    
    # 3 units of item id=1 with durability=2
    Name;1::2 3
    
    # 4 units of item id=1 with data=2 and durability=3
    Name;1:2:3 4
    
    # Ofcourse, the optional cooldown timer and multiple item definitions are supported as before
    Starterkit;268 1;269 1;-300
    
    # Or any combination of the above (this is what you've been waiting for)
    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
    
    Oh, and both "kit" and "kit reload" now work from the server console.
     
  8. Thank You! You just saved me a huge headache with trying to get it working.

    Hmm.. now I'm having trouble with any kits past starterkit...

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

    UndeadLex

    I also seem to be having troubles with the durability, negative numbers or positive ones have no effect. One hit and the health bar shows up.
    Wool works. Will give the half-slabs and wood a go, although I'm sure they'll be no issue.
     
  10. Offline

    FloydATC

    Can you define "trouble"? Error messages and config file would be a great help :)
     
  11. Offline

    HandOfCode

    I have a question, is there a way to give multiple -1 stacks of an item instead of having them add to each other? (I realize when items are not 64 the game will try to add them to the stack and roll back because it's stored in one byte)

    Side note: THANK YOU for colours and durability!!!
     
  12. Offline

    FloydATC

    No, I have no control over the stacking of items since I basically just call
    Code:
    player.getInventory.addItem(itemstack);
    Unfortunately, the game will then split that stack and merge with existing stacks as it sees fit. Unfortunately this particular bit of code currently ignores item data. This is why, if you have a stack of <64 white wool in your inventory and receive a single unit of wool in any color, it will just add another white wool to the existing stack.

    Maybe if I scanned the inventory and manipulated the slots manually to work around this particular bug. Which I won't do, sorry. Life and all that :)
     
  13. Offline

    MacVaultDweller

    Would love to see a /kit give [player name] [name of kit] command
     
  14. Offline

    FloydATC

    This feature has now finally been implemented. Version 1.12 has been posted, but the syntax is a bit different than what you suggest. I think it's easier:

    • To give yourself a starterkit, this works as before:
    Code:
    /kit starterkit
    • To give NewPlayer a starterkit:
    Code:
    /kit starterkit NewPlayer
    • You can specify more than one name:
    Code:
    /kit starterkit NewPlayer Noobie FreshMeat
    • In order to give kits to other players, the player giving away the kit must have a new permission:
    Code:
            - 'kit.proxy'
    This permission bypasses any cooldown check. The cooldown timer of the giving player is still updated, so if that player is later demoted/stripped of his proxy permission he must wait for the cooldown. The cooldown timer of the receiving player is always unaffected; from the plugin's point of view he/she did not request anything -- the gift comes without any strings attached.
    • Partial player names are ok and the names are case-insensitive. (This is a feature in Bukkit, not the plugin itself)
    • Kits may be given from the server console.
     
  15. Offline

    MacVaultDweller

    Perfect Perfect Perfect Thank you very much! Hats of to you Sir
     
  16. Offline

    MacVaultDweller

    MANY THANKS FOR YOUR PLUGIN DEVELOPMENT WORK AND SUPPORT
    Too many players for your server?
    Have the people you trust come and visit us while they
    are waiting for an opening on your sever. We are a small 20 player developed world with
    player slots ready to be filled. We have a Sanctuary City with tough rules but free build
    areas as well. Bukkit people are always welcome to visit.
    http://newworldminecraft.tk/
     
  17. Offline

    Thoth

    Please update it? :S
     
  18. Offline

    Andrew0085

    Does this work with 602 or whatever the new ver. is?
     
  19. Offline

    r3Fuze

    Seems like the cooldown is broken with the new version.
     
  20. Offline

    binboum

    Update pleez 1.4 no found..
     
  21. Offline

    MacVaultDweller

    Looking forward to the update for CB617
     
  22. Offline

    FloydATC

    I have just tested cooldown on #600, #602 and #617 without any unexpected problems. However, I suspect that the reason for the cooldown appears to be broken is that you have granted kit.* to your players.

    This includes 'kit.proxy' which, as explained earlier, allows the player to bypass the cooldown.

    I have posted an updated version 1.13 which logs an informational notice whenever a player requests (or grants) a kit actively bypassing a cooldown.
     
  23. Offline

    ksevelyar

    Could you please add iConomy support?
     
  24. Offline

    FloydATC

    Yes, it's on my TODO list. I've gotten as far as installing and configuring iConomy but need a quiet moment to wrap my head around the API, still being a Java newbie and all...

    In the mean time, I just uploaded an update to version 1.14 which improves the permission checking and logging a bit to make troubleshooting a little less painful. There are no new features in this version.

    Version 1.15 is now out, finally with optional iConomy support! The format of kits.txt has been extended to allow an optional price tag:

    Code:
    Rock;1 256;$10
    If iConomy is not available or the player has 'kit.proxy' permission, the price tag is ignored and the kit is dispensed for free as before.

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

    MacVaultDweller

    I loved your plugin before but the iConomy support along with the cool down option will really help to control
    kit abuse by some of my players.
    THANK YOU! for your hard work and support.

    Should cost and time go in this order
    Torchkit;85 1;87 1;323 4;$100;-3600

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

    Silba93

    I have a problem, Here is the console message.

    17:04:00 [INFO] [Kit] silba93 requested kit canon_kit
    17:04:00 [INFO] [Kit] Ignoring cost of 600 for silba93 (-1021 seconds) because o
    f 'kit.proxy' permission
    17:04:00 [INFO] [Kit] Giving a kit to silba93: canon_kit


    Why is it ignoring the cost of 600? I dont understand. I want to be able to play normally and be admin too. I still want to pay for my kits.

    Ive removed my permission kit.proxy and that didnt work... i tried being just a moderator... that didnt work either.
     
  27. Offline

    FloydATC

    The order does not matter. Or, rather, it should not matter.

    The reason I chose to ignore the cost for kit.proxy users is that since moderators are usually free to hand out free kits, they are in a position to circumvent the economy anyway; they could just give free kits to a friend and have the friend hand the equipment back to them. Ofcourse, I may change this if it turns out to have been a bad call.

    Meanwhile, if you strip yourself of the kit.proxy permission, you should be charged the cost like everyone else. I have tested this by granting myself the following permissions:
    Code:
    - '*'
    - '-kit.proxy'
    I'm not sure if the order matters here, I suspect that in some implementations it does.
     
  28. Offline

    binboum

    I use it just in the way "war" is possible?
     
  29. Offline

    darthsiddious

    is there a possibility of boseconomy support? i really need a kit plugin and i use boseconomy. thank you very much sir
     
  30. Offline

    Silba93


    Thanks alot man. Appreciated.

    Going to test it out soon :) I hope it works!
     
  31. Offline

    FloydATC

    Sorry, can you rephrase that?

    I've never heard about that one before, I'll look into it. At first glance, the API seems to be missing a couple of things to make it transaction safe but other than that it seems pretty straightforward.
     

Share This Page