[ADMN] GiveTo v0.8 - Give Items / Kits to Others or Self, Permissions/Economy - /gto | /gme [1597]

Discussion in 'Inactive/Unsupported Plugins' started by ltguide, Mar 29, 2011.

  1. Offline

    ltguide

    GiveTo - Give Items (& Kits) to Others or Self, Permissions/Economy Support
    Version: v0.8
    CraftBukkit: 1000, 1060, 1185, 1240, 1337

    GiveTo is an easy way to give items to other players or yourself. Using Permissions or EssentialsGroupManager (w/ EssentialsGroupBridge) allows fine administrative control. GiveTo supports iConomy 4/5/6, BOSEconomy 7, MultiCurrency, and Essentials Economy via Register.

    You can give an item by ID or NAME. If no item matches directly, GiveTo attempts to search for a matching item. If there is more than one result, you are presented a list of matches.

    You can also specify an amount to give. Each item can have its own default and max amounts. Or GiveTo will use the global amounts configured.

    Features:
    • Item ID or Name with searching & results
    • Global/Item-specific default and max amounts
    • Global/Item-specific costs
    • Global/Item-specific delays (cooldown)
    • Quick self-give command
    • Items can have multiple aliases and also act as a kit
    • Customizable messages
    • Configurable command names (with plugin.yml change)
    • Permissions Support (else OPs): command use, reload, specific items/kits, delay/cost exemptions
    Commands:

    GiveTo adds two commands: /giveto (/gto /give) and /giveme (/gme). Both accept "reload" as the first argument to trigger a reload of the config.yml. /gto has full functionality from the console.
    • /gto <player> <item> [count]
    • /gme <item> [count]
    The player can be a player name or "me." As long as there is only one match, you can enter part of a player name. Entering /gto ltg ... will give items to "ltguide."


    The item can be an ID number or text that includes spaces or * as a wildcard. For example, assume you have two items: cobblestone and cobblestone stairs. Entering /gme co st 3 will display the two items. However, /gme co sta 3 will give you 3 cobblestone stairs. You could also use c a, but it actually matching would depend on what other items you have added.

    You can also specify a "durability" that will override the one set in config. For example, /gme sapling:1 will give you a Spruce Sapling. This is useful for Maps since there are too many to conveniently list in the config.

    If you want to change the commands, then you need to change them in plugin.yml inside the .jar. (7-zip: open jar, right-click plugin.yml, "Edit")

    Configuration
    Show Spoiler
    Code:
    count:
        max: 512
        def: 64
    delay: 0
    cost: 0
    updateinventory: ['someclientmoduser','anothersuchuser']
    messages:
        arglength: '&5Syntax: &f%s'
        permission: '&cYou do not have permission.'
    items:
        stone:
            alias: rock
            id: '1'
        kit:
            def: 1
            max: 1
            permission: beginnerset
            delay: 600
            cost: 5
            id:
            - '276'
            - '277'
            - '278'
            - '279'
            - '259'
            - '288'
    
    That is a sample configuration. The full config.yml will be created in the plugins/GiveTo folder when you start the server. You can also download the full config.yml below. YML files requires spaces instead of tabs and the level of indention matters.

    Count:
    If no amount is specified to /gto or /gme then the "def" value is used. The "max" value is the maximum amount that can be given per item.

    Delay:
    If no delay (cooldown) is specified in the item, then the global delay is used. The delay on a specific item can be less than the global.

    Cost:
    If a cost is specified in the config, then Register.jar will be created in the lib/ folder when you start the server. You will need to reload/restart the server or no money will be deducted from a player's account. The cost on a specific item can be less than the global.

    Update Inventory:
    Client mods for inventory (TooManyItems) require updateInventory() to visually update. However, this API method is deprecated so it shouldn't be used because a future update may remove it. Using this call resends the entire inventory to the player, so it requires more bandwidth from the server. By default the GiveTo plugin will not use it, but it can be enabled for certain users or globally with '*' if a lot of users request it.

    Messages:
    You can use Color Codes to control the colors in messages. You can flip the order of replacements by using %2$s and %1$s instead of %s. You don't have to use every replacement either, i.e. not showing balance.

    Items:
    item name - can contain spaces, i.e. glowstone block
    • id - required - ID as string: '1' or ID as string list: ['276','277'] (or in long form; see above config); for durability values use a colon: '35:4'
    • alias - optional - another common name, i.e. netherstone for netherrack (can also be a list, see 'id' above)
    • def - optional - default amount
    • max - optional - maximum amount
    • delay - optional - delay seconds before giving item again(cooldown)
    • cost - optional - money amount
    • permission - optional - if specified, the user needs to have giveto.item.PERMISSION to give
    Permissions:
    • giveto.others - /gto
    • giveto.self - /gme
    • giveto.reload - /g* reload
    • giveto.item.PERMISSION - required if you set an item specific permission
    • giveto.exempt.delay - exempt from delay period
    • giveto.exempt.cost - exempt from cost (all items FREE)
    You can assign the same permission to multiple items (i.e., permission: builder) then assign a user or group 'giveto.item.builder' It's probably a good idea to add a permission to lava, bedrock, etc.

    If any Permissions-like plugins are not available then Bukkit Permissions (SuperPerms) is used which, by default, will grant all access to OPs only.


    Download GiveTo Plugin (Static)
    Download GiveTo Plugin (version in filename)
    View Full Items List
    Source Code

    Changelog:
    Version 0.8
    • added new items
    • updated Register support (no longer needed in /lib)
    • uses Bukkit Permissions (SuperPerms) if no Permissions-like plugin
    Version 0.7
    • added configurable updateInventory() for client mod fix
    • updated Register support (iConomy 6, MultiCurrency, BOSE7)
    • fix cost message showing previous balance
    Version 0.62
    • add new items
    Version 0.61
    • remove need for utf-8 encoded config.yml (now uses & for color instead of unicode)
    • updated economy support
    • fix default durability (fixes unable to craft with some spawned items)
    • fix name lookup with specified durability (yellow wool:5 is really Light Green Wool)
    Show Spoiler
    Version 0.6
    • customizable messages
    Version 0.5
    • able to specify custom durability on item (map:2)
    • economy support (cost)
    • delay periods/cooldown (delay)
    • permissions for cost/delay exemptions
    • multiple aliases per item
    Version 0.4
    • properly use command aliases in plugin.yml
    • remove unnecessary if from onCommand
    • override /give
    • inventory full message
    Version 0.3
    • No longer requires target as exact player name, will search
    Version 0.2
    • Displays loaded items onEnable and reload
    • Minor cleanup from pre-release
    Version 0.1
    • Initial release
     
    ElectrON and AS1LV3RN1NJA like this.
  2. Offline

    ltguide

    Version 0.5
    • able to specify custom durability on item (map:2)
    • economy support (cost)
    • delay periods/cooldown (delay)
    • permissions for cost/delay exemptions
    • multiple aliases per item

    Also, the full config.yml will copy itself to plugins folder if it's ever empty.

    update tags: @Erwinner @jsschmitt @Bjourk @musicin3d
     
  3. Offline

    TheNinjaTurkey

    um. when i load my server it says that only 2 items have been loaded, and it seems that the only thing i can spawn is stone, if i try anything else, even with the data value instead of the name it says "no matching items"
     
  4. Offline

    ltguide

    It uses the items list to find valid items (giving people bad items crashes their client), so it needs to see way more than 2. What does your config.yml look like? Paste it here in spoiler tags. And what CB version?
     
  5. Offline

    Koltrast

    This plugin is great, it works like a charm! Thank you!
     
  6. Offline

    Tomskied

    Oh no don't worry, I was jsut being lazy. But I have another problem with permissions now not working very well. I can't restrict items when I have given them permissions.:
    Code:
    count:
        max: 512
        def: 64
    delay: 0
    cost: 0
    items:
        kit:
            def: 1
            max: 1
            permission: Architect
            delay: 0
            id:
            - '256'
            - '257'
            - '258'
        Modkit:
            def: 1
            max: 1
            permission: Mod
            id:
            - '277'
            - '278'
            - '279'
        Stone:
            id: '1'
        Grass:
            id: '2'
        Dirt:
            id: '3'
        Cobblestone:
            id: '4'
        Wooden Plank:
            id: '5'
        Sapling:
            id: '6'
        Spruce Sapling:
            id: '6:1'
        Birch Sapling:
            id: '6:2'
        Bedrock:
            id: '7'
            permissions: Admins
    
    
    This is just a snippet, but its all the same layout as that. But the permissions won't work.
    for example an "Architect" can spawn bedrock, I have given ARchitect the permission, giveto.self.Architect and giveto.self for the items without permissions. What am i doing wrong?

    Great plugin btw :)
     
  7. Offline

    ltguide

    You have an 's' on permissions under bedrock. Also, make sure you are using giveto.item.Architect for specific permissions.
     
  8. Offline

    Tomskied

    Ah, I did have giveto.item.Architect, the problem was that permission(s). Thanks for clearing that up :)
     
  9. Offline

    ltguide

    Sure, no problem :)
     
  10. Offline

    musicin3d

    Wonderful! :D
     
  11. Offline

    jsschmitt

    My hero!
     
  12. Offline

    ltguide

    Anyone interested in being able to customize the messages that GiveTo sends?

    oh, wait, never mind...

    Version 0.6
    • customizable messages

    Any suggestions?
     
  13. Offline

    o0AzzA0o

    I know this sounds crazy but this plugin is spawning fake items..... if you give yourself diamond and sticks for example you cant make tools from it ....... try same with coal and sticks you cant make torch .... yet when i collect the mats i can craft item fine
     
  14. Offline

    ltguide

    I see. That's really weird. Diamond Block makes Diamond. Wooden Plank makes Stick. Then you can make Diamond Pickaxe. But not from Diamond and Stick spawned directly.

    I'll investigate more :eek:
     
  15. Offline

    jamescosten

    i have an issue

    Show Spoiler
    [SEVERE] Could not load 'plugins/GiveTo.jar' in folder 'plugins':
    unacceptable character #FFFD special characters are not allowed
    in "<reader>", position 75
    at org.yaml.snakeyaml.reader.StreamReader.checkPrintable(StreamReader.java:68)
    at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:159)
    at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:117)
    at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:106)
    at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:964)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:237)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:183)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseImplicitDocumentStart.produce(ParserImpl.java:200)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:104)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
    at org.bukkit.util.config.Configuration.load(Configuration.java:82)
    at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:157)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:175)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:199)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:89)
    at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  16. Offline

    ltguide

    @jamescosten

    Were you upgrading or a fresh install? Please let me know which, but I assume upgrading.
    You have to change the encoding of config.yml to utf-8. Use "Save as" in notepad, or the Encoding menu in Notepad++.

    I've got a fix for the crafting problem ready to roll, but I'm gonna see about just replacing the unicode character for color so that the utf-8 requirement goes away before I upload it.
     
  17. Offline

    jamescosten

    Fresh Install then copied the config and saved, i get you now will do as mentioned mate,
     
  18. Offline

    ltguide

    Version 0.61
    • remove need for utf-8 encoded config.yml (now uses & for color instead of unicode)
    • updated economy support
    • fix default durability (fixes unable to craft with some spawned items)
    • fix name lookup with specified durability (yellow wool:5 is really Light Green Wool)

    @o0AzzA0o this should fix the bug you noticed

    And there shouldn't be anymore bad configs created, but we'll see :)
     
    o0AzzA0o likes this.
  19. Offline

    o0AzzA0o

    thanks for sorting this issue out so quickly your inventory plugin is the most simple to use for me.
     
  20. Offline

    ltguide

    Version 0.62
    • add new items
    Add these to plugins/GiveTo/config.yml
    Code:
        Leaves:
            id: '18'
        Sticky Piston:
            id: '29'
        Tall Grass:
            id: '31'
        Dead Shrubs:
            id: '32'
        Piston:
            id: '33'
        Shears:
            id: '359'
    
    Be careful with pistons until there is another update. Play with them on a temp map.
     
  21. Offline

    RazerM

    A couple of bugs I've noticed;

    /gme stone slab (or double slab) spawns items that crashes the client when you mouseover the item in the inventory.

    Changing config.yml to add :0 to itemid fixes this.

    Iron ingots do not let you craft. Adding :0 to the itemid in config.yml fixes this too.

    I suspect there are more but haven't tested. This happened on bukkit 935 and still same issues on 946.

    Great plugin, hopefully it is an easy fix.

    Edit: Now that I think of it, using /gme hasn't been filling up existing stacks. eg I have 12 (real) dirt in my inventory and /gme dirt 5 starts a new stack of 5 next to the stack of 12
     
  22. Offline

    ltguide

    @RazerM
    That bug should have been fixed in 0.61. Have you upgraded?
     
  23. Offline

    RazerM

    Sorry you're correct I hadn't noticed it in CraftBukkitUpToDate.
     
  24. Offline

    ReploidGodX

    I love this plugin, so much. Just the /gme command so I don't have to type out my name everytime I want to give something to myself is worth the download. But even better is the fact that I don't have to remember those damn item ID's, or print out a sheet of them or even tab back and forth. This plugin is definitely my favorite for sure. Kudos to you sir.
     
  25. Offline

    musicin3d

    Yeah I use this one the most. Double props.
     
  26. Offline

    Bokenbergen

    Got all setup but its sayin:an internal error occured while attemmting bla bla bla!
    WHY!=!==!
     
  27. Offline

    ltguide

    I need to know exactly what version of CraftBukkit you are running and the full java error message from the console log. Preferably surrounded by spoiler tags.
     
  28. Offline

    musicin3d

    I was just thinking. What if there was an option where a kit cleared the player's inventory? We could create kits for pvp arenas, spleef arenas, etc.
     
  29. Offline

    Th3Controller

    I love your chubby cat its cute! Do they have a dog? Oh and by the way great plugin better than any other giving plugin (definitely better than vanillas :p) Your plugin sir deserves to be the replacement for Essentials Give/Item I also love word matching cause I keep forgetting item names :D Back to the chubby cat so do they have a dog xD
     
  30. Hey Dude.
    I have a little problem. Your Plugin works fine but, when I give some items to myself by using TooManyItems, the Items are in my inventory but they are invisible. They appear when i click on them. It's not a big problem but i want you to know that^^
     
  31. Offline

    ltguide

    @EchoOfTime
    This sounds like the issue. Does re-opening your inventory make the items show up?
     

Share This Page