[MECH/RPG] CraftGroup v0.3.1 - Prevent crafting of specific items and blocks [1000]

Discussion in 'Inactive/Unsupported Plugins' started by FrozenBrain, Jul 10, 2011.

  1. Offline

    FrozenBrain

    CraftGroup - Prevent crafting of specific items and blocks
    Version: v0.3.1
    CraftBukkit Build: 1000

    CraftGroup lets you assign so-called CraftGroups to the players of your server via Permissions. Those CraftGroups can be used to prevent crafting, smelting, using, placing or breaking of specific items and blocks. This is propably most useful for RPG servers.

    How to use:
    Show Spoiler

    Download the plugin and drop it in your plugins folder. After the first run, BukkitContrib will be downloaded (if it's not installed already) and a file called "config.yml" will be created inside the plugins/CraftGroup directory.

    You can now create new CraftGroups by simply adding a new node to this file.

    Example:
    Code:
    version: 13
    
    global-blacklist:
        break:
    # Don't break TNT
        - -TNT
        craft:
    # Don't craft orange wool
        - -WOOL:1
        use:
    # Don't use golden apples
        - -GOLDEN_APPLE
        place:
    Blaster:
        break:
        craft:
    # Even though the global-blacklist prevents everyone from crafting TNT,
    # we can whitelist it here again.
        - TNT
        use:
        place:
    Note: The 'use' rules are quite buggy. That's not my fault, CraftBukkit fails at this point. Maybe I'll find a workaround soon.

    As you can see, you can use either the name or the id of the item or block. If you want to prevent someone from crafting, placing, breaking or using something, put a "-" in front of the item (this blacklists the item). You can also whitelist an item by not putting a "-" there. This overwrites the blacklist rules.

    After setting up the CraftGroups, open up your Permissions configuration files and assign the CraftGroups to your groups or players by giving them the
    Code:
    craftgroup.group.GROUPNAME
    permission (replace GROUPNAME with the actual name of the CraftGroup).

    Remember that the CraftGroups and the "craftgroup.group.GROUPNAME" permission are case-sensitive!

    Permissions:
    PermissionNeeded to...
    craftgroup.addUse /cg add
    craftgroup.removeUse /cg remove
    craftgroup.listUse /cg list
    craftgroup.reloadUse /cg reload
    craftgroup.bypassBypass all restrictions
    craftgroup.group.GROUPNAMEAssign a CraftGroup (replace GROUPNAME with the name of the CraftGroup)


    Commands:
    CommandDescriptionUsage
    /cg addAdd an item or block to a group/cg add <list> <allow/deny> <type> <item>
    /cg remove <list> <allow/deny> <type> <item>Remove an item or block from a group/cg remove <list> <item>
    /cg listShow all lists or items in a group/cg list [list ] [type/*] [page]
    /cg reloadReload the configuration file/cg reload

    You can also use /craftgroup instead of /cg.

    Features:
    • Prevent crafting, smelting, using, placing or breaking of items and blocks
    • Assign CraftGroups to players and groups via Permissions
    • Multi-World (not with Permissions 2)
    • Ingame-Editing of CraftGroups
    • bypass-permission for Admins
    • Global Black-/Whitelist
    • Support for data values
    • Support for ItemCraft

    Download CraftGroup-dev (.jar; Minecraft 1.8; Spout)
    Download CraftGroup v0.3.1 (.jar)
    Source on GitHub
    [​IMG]

    Changelog:
    Version 0.3.1
    • Fixed 2 NPEs
    Version 0.3.0
    • Support for data values
    • Support for ItemCraft (requires testing)
    Show Spoiler
    Version 0.2.2
    • Fixed a problem with the different permission types
    Version 0.2.1
    • Fixed global-blacklist
    Version 0.2.0
    • Added support for permissions 2 and groupmanager (untested)
    • You can now prevent people from placing, destroying and using items/blocks
    Version 0.1.2
    • Forgot that HashMaps are case-sensitive
    Version 0.1.1
    • Never try casting an integer to a string!
    Version 0.1
    • Initial release
     
    Nomanoclass likes this.
  2. Offline

    killacalli

    Ah ok thanks :D
     
  3. Offline

    p000ison

    Yeah your plugin is one of the best plugins. ;D
    Thank you so mutch.

    Code:
    version: 13
    global-blacklist:
        break:
        craft:
        - -TNT
        use:
        place:
    testgroup1:
        break:
        craft:
        - TNT
        use:
        place:
    testgroup2:
        break:
        craft:
        use:
        place:
    
    So the problem is now that testgroup2 can't place break or use TNT. But I only want to
    prevent the Crafting of TNT. testgroup1 can place and craft it.
    So there is no difference betwen Crafting and Break,Place,Use.

    Ther Permissions Nodes are:

    craftgroup.group.testgroup1
    craftgroup.group.testgroup2

    If I leave testgroup2 its the same Problem.

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

    FrozenBrain

    Redownload the plugin please, 0.2.2 just came out.
     
  5. Offline

    p000ison

    Thx now all works. :)
     
  6. Offline

    m5k

    Just to note, that the "21:53:08 [SEVERE] java.lang.NoSuchFieldException: perm" error is purely from bukkitcontrib 1.7. Older versions worked fine I believe.
     
  7. Offline

    FrozenBrain

    Just to make sure I'm not missing something.. Does anyone still have any kind of problem with the plugin? If not, are there any suggestions?
     
  8. Offline

    Milchshakee

    Only bukkitcontrib has Problems^^
    And...can you pls add Numbers like 35:2 ? :D

    The 2.2 update is really nice..but World Guard has the same functions like your on-place and on-break functions. Or am i wrong ? :eek:

    And if you prevent users from Using Bows...Can they shoot arrows or not ?
     
  9. Offline

    alfskan

    is it impossible to make a none bukkitcontrib version?
    because Im using modloadermp:'(
     
  10. Offline

    killacalli

    im having problems with the bukkitcontrib, this pluggin still won't work even with that error :( a non bukkitcontrib version would be awesome
     
  11. Offline

    FrozenBrain

    Data values are planned already. And no, it does not prevent them from using bows (it should however) because of a bug in craftbukkit. Preventing the usage of tools works fine.

    Nope, that's not possible as I would have to entirely rewrite parts of the netserverhandler. This would conflict with BukkitContrib if it's installed for an other plugin. You'll have to wait for an update of BukkitContrib, sorry.
     
  12. Offline

    alfskan

    oh...ok..:'(

    bukkicontrib developer said will never support modloadermp.

    I have to wait another same function plugin..:'(
     
  13. Hi, sounds interesting.
    What's with Permissions 3.x and CB1000 ?
     
  14. Offline

    FrozenBrain

    It's working fine with Permissions 3 and it also should with CB1000 since there were no plugin breaking changes afaik.
     
  15. Offline

    Lirycs78

    Hi,
    I have a problem with your plugin. My config file :

    version: 13
    global-blacklist:
    break:
    craft:
    - -TNT
    - -202
    - -203
    - -204
    - -205
    - -206
    - -207
    - -208
    - -209
    - -210
    - -211
    - -212
    - -213
    use:
    place:
    Peintre:
    break:
    craft:
    - 202
    use:
    place:
    Cuisinier:
    break:
    craft:
    - 205
    - 206
    - 207
    use:
    place:
    Ferailleur:
    break:
    craft:
    - 203
    - 204
    use:
    place:
    Macon:
    break:
    craft:
    - 208
    - 209
    - 210
    use:
    place:
    Armurier:
    break:
    craft:
    - 211
    - 212
    - 213
    use:
    place:

    And, the Armurier can craft ther id 202, and I dont understand why :s
    Thx you.

    Nobody ? :'(

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

    Kazer

    For blocking the crafting, can you just let the result empty ? Because I think is not beautiful to just put back the object =/
     
  17. Bow works!
    Yeah, you can shoot it, but you do no damage :)

    When will data-value support be integrated?
     
  18. Offline

    Milchshakee

    If you don't need use: or place: then delete it^^
     
  19. Offline

    Lirycs78

    please, can you update your plugin to render compatible with ItemCraft ?
    Because, When I type the id of my mod, in the Group-Craft list, I see ITEMCRAFT_ITEM
     
  20. Offline

    Flenix

    Code:
    version: 13
    global-blacklist:
        break:
        - -CROPS
        - -SUGAR_CANE_BLOCK
        - -CACTUS
        - -SEEDS
        - -SUGAR_CANE
        craft:
        - -STONE
        - -GLASS
        - -LAPIS_BLOCK
        - -DISPENSER
        - -SANDSTONE
        - -NOTE_BLOCK
        - -BED
        - -POWERED_RAIL
        - -DETECTOR_RAIL
        - -PISTON_STICKY_BASE
        - -PISTON_BASE
        - -STEP
        - -BRICK
        - -TNT
        - -BOOKSHELF
        - -WOOD_STAIRS
        - -CHEST
        - -DIAMOND_BLOCK
        - -WORKBENCH
        - -FURNACE
        - -LADDER
        - -RAILS
        - -COBBLESTONE_STAIRS
        - -LEVER
        - -STONE_PLATE
        - -WOOD_PLATE
        - -REDSTONE_TORCH_ON
        - -STONE_BUTTON
        - -SNOW_BLOCK
        - -CLAY
        - -JUKEBOX
        - -FENCE
        - -JACK_O_LANTERN
        - -TRAP_DOOR
        - -IRON_SPADE
        - -IRON_PICKAXE
        - -IRON_AXE
        - -FLINT_AND_STEEL
        - -BOW
        - -ARROW
        - -IRON_SWORD
        - -STONE_SWORD
        - -STONE_SPADE
        - -STONE_PICKAXE
        - -STONE_AXE
        - -DIAMOND_SWORD
        - -DIAMOND_SPADE
        - -DIAMOND_PICKAXE
        - -DIAMOND_AXE
        - -BOWL
        - -MUSHROOM_SOUP
        - -GOLD_SWORD
        - -GOLD_SPADE
        - -GOLD_PICKAXE
        - -GOLD_AXE
        - -STONE_HOE
        - -IRON_HOE
        - -DIAMOND_HOE
        - -GOLD_HOE
        - -BREAD
        - -LEATHER_HELMET
        - -LEATHER_CHESTPLATE
        - -LEATHER_LEGGINGS
        - -LEATHER_BOOTS
        - -CHAINMAIL_HELMET
        - -CHAINMAIL_CHESTPLATE
        - -CHAINMAIL_LEGGINGS
        - -CHAINMAIL_BOOTS
        - -IRON_HELMET
        - -IRON_CHESTPLATE
        - -IRON_LEGGINGS
        - -IRON_BOOTS
        - -DIAMOND_HELMET
        - -DIAMOND_CHESTPLATE
        - -DIAMOND_LEGGINGS
        - -DIAMOND_BOOTS
        - -GOLD_HELMET
        - -GOLD_CHESTPLATE
        - -GOLD_LEGGINGS
        - -GOLD_BOOTS
        - -GRILLED_PORK
        - -PAINTING
        - -GOLDEN_APPLE
        - -SIGN
        - -WOOD_DOOR
        - -BUCKET
        - -MINECART
        - -IRON_DOOR
        - -BOAT
        - -MILK_BUCKET
        - -CLAY_BRICK
        - -PAPER
        - -BOOK
        - -STORAGE_MINECART
        - -POWERED_MINECART
        - -COMPASS
        - -FISHING_ROD
        - -WATCH
        - -COOKED_FISH
        - -CAKE
        - -BED
        - -DIODE
        - -COOKIE
        - -MAP
        - -SHEARS
        use:
        - -IRON_SWORD
        - -WOOD_SWORD
        - -STONE_SWORD
        - -DIAMOND_SWORD
        - -GOLD_SWORD
        - -LEATHER_HELMET
        - -LEATHER_CHESTPLATE
        - -LEATHER_LEGGINGS
        - -LEATHER_BOOTS
        - -CHAINMAIL_HELMET
        - -CHAINMAIL_CHESTPLATE
        - -CHAINMAIL_LEGGINGS
        - -CHAINMAIL_BOOTS
        - -IRON_HELMET
        - -IRON_CHESTPLATE
        - -IRON_LEGGINGS
        - -IRON_BOOTS
        - -DIAMOND_HELMET
        - -DIAMOND_CHESTPLATE
        - -DIAMOND_LEGGINGS
        - -DIAMOND_BOOTS
        - -GOLD_HELMET
        - -GOLD_CHESTPLATE
        - -GOLD_LEGGINGS
        - -GOLD_BOOTS
        - -BOW
        place:
        - -CROPS
        - -SUGAR_CANE_BLOCK
        - -CACTUS
        - -SEEDS
        - -SUGAR_CANE
    Blacksmith:
        break:
        craft:
        - DISPENSER
        - NOTE_BLOCK
        - POWERED_RAIL
        - DETECTOR_RAIL
        - RAILS
        - LEVER
        - STONE_PLATE
        - WOOD_PLATE
        - REDSTONE_TORCH_ON
        - STONE_BUTTON
        - JUKEBOX
        - BUCKET
        - MINECART
        - BOAT
        - STORAGE_MINECART
        - POWERED_MINECART
        - DIODE
        use:
        place:
    Builder:
        break:
        craft:
        - STONE
        - WOOD
        - GLASS
        - SANDSTONE
        - STEP
        - BRICK
        use:
        place:
    Armourer:
        break:
        craft:
        - STONE_SWORD
        - IRON_SWORD
        - GOLD_SWORD
        - DIAMOND_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        - CHAINMAIL_HELMET
        - CHAINMAIL_CHESTPLATE
        - CHAINMAIL_LEGGINGS
        - CHAINMAIL_BOOTS
        - IRON_HELMET
        - IRON_CHESTPLATE
        - IRON_LEGGINGS
        - IRON_BOOTS
        - DIAMOND_HELMET
        - DIAMOND_CHESTPLATE
        - DIAMOND_LEGGINGS
        - DIAMOND_BOOTS
        - GOLD_HELMET
        - GOLD_CHESTPLATE
        - GOLD_LEGGINGS
        - GOLD_BOOTS
        - BOW
        - ARROW
        - TNT
        use:
        place:
    CosmeticEngineer:
        break:
        craft:
        - LAPIS_BLOCK
        - BOOKSHELF
        - SNOW_BLOCK
        - CLAY
        - PAINTING
        - SIGN
        - WOOD_DOOR
        - IRON_DOOR
        - CLAY_BRICK
        use:
        place:
    Chef:
        break:
        craft:
        - BOWL
        - MUSHROOM_SOUP
        - BREAD
        - GRILLED_PORK
        - GOLDEN_APPLE
        - COOKED_FISH
        - SUGAR
        - COOKIE
        use:
        place:
    Farmer:
        break:
        - CROPS
        - SUGAR_CANE_BLOCK
        - CACTUS
        - SEEDS
        - SUGAR_CANE
        craft:
        - JACK_O_LANTERN
        - PAPER
        - BOOK
        - SUGAR
        use:
        place:
        - CROPS
        - SUGAR_CANE_BLOCK
        - CACTUS
        - SEEDS
        - SUGAR_CANE
    Carpenter:
        break:
        craft:
        - WOOD_STAIRS
        - CHEST
        - WORKBENCH
        - FURNACE
        - LADDER
        - COBBLESTONE_STAIRS
        - FENCE
        - BED
        use:
        place:
    Toolsmith:
        break:
        craft:
        - STONE_SPADE
        - STONE_PICKAXE
        - STONE_AXE
        - STONE_HOE
        - IRON_SPADE
        - IRON_PICKAXE
        - IRON_AXE
        - IRON_HOE
        - GOLD_SPADE
        - GOLD_PICKAXE
        - GOLD_AXE
        - GOLD_HOE
        - DIAMOND_SPADE
        - DIAMOND_PICKAXE
        - DIAMOND_AXE
        - DIAMOND_HOE
        - FLINT_AND_STEEL
        - COMPASS
        - FISHING_ROD
        - WATCH
        use:
        place:
    Warrior:
        break:
        craft:
        use:
        - IRON_SWORD
        - WOOD_SWORD
        - STONE_SWORD
        - DIAMOND_SWORD
        - GOLD_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        - CHAINMAIL_HELMET
        - CHAINMAIL_CHESTPLATE
        - CHAINMAIL_LEGGINGS
        - CHAINMAIL_BOOTS
        - IRON_HELMET
        - IRON_CHESTPLATE
        - IRON_LEGGINGS
        - IRON_BOOTS
        - DIAMOND_HELMET
        - DIAMOND_CHESTPLATE
        - DIAMOND_LEGGINGS
        - DIAMOND_BOOTS
        - GOLD_HELMET
        - GOLD_CHESTPLATE
        - GOLD_LEGGINGS
        - GOLD_BOOTS
        place:
    Ranger:
        break:
        craft:
        use:
        - BOW
        - CHAINMAIL_HELMET
        - CHAINMAIL_CHESTPLATE
        - CHAINMAIL_LEGGINGS
        - CHAINMAIL_BOOTS
        - WOOD_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        place:
    BattleMage:
        break:
        craft:
        use:
        - WOOD_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        place:
    CombatEngineer:
        break:
        craft:
        use:
        - WOOD_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        - STONE_SWORD
        - IRON_SWORD
        place:
    Assassin:
        break:
        craft:
        use:
        - IRON_SWORD
        - WOOD_SWORD
        - STONE_SWORD
        place:
    Summoner:
        break:
        craft:
        use:
        - CHAINMAIL_HELMET
        - CHAINMAIL_CHESTPLATE
        - CHAINMAIL_LEGGINGS
        - CHAINMAIL_BOOTS
        - WOOD_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        place:
    Psychic:
        break:
        craft:
        use:
        - WOOD_SWORD
        - LEATHER_HELMET
        - LEATHER_CHESTPLATE
        - LEATHER_LEGGINGS
        - LEATHER_BOOTS
        - STONE_SWORD
        place:
    Bowman:
        break:
        craft:
        use:
        - BOW
        place:
    
    There's my full config. If I have no groups assigned and just use the global blacklist, I can punch a mob fine but not use any sword. If I give myself a group here (for example, Armourer) I can't attack with any weapon or even punch a mob...

    Any idea why? Its a biiig config, so I guess I just cocked up somewhere.

    (Also, I love the new update, it makes everything MUCH clearer for people like me :) and a lot easier too.

    @FrozenBrain - any idea why its happening?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  21. @Flenix
    You didn't whitelist any weapon for the armourer.
    Yeah he may craft everything, but there's no permission to use weapons!
     
  22. Offline

    morizuki

    aw.. so u need bukkitcontrib :(
     
  23. Offline

    Flenix

    Oh, forgot to point out the crucial part that I also had BattleMage :p
     
  24. Hmm ok, try deleting the empty use, destroy, ... parts. I think they overwrite each other.
     
  25. Offline

    Lirycs78

    It's possible that your plugin is compatible with ItemCraft for lock craft of my new item ?
    Because, i have bug, all my new item (id : 200, 201, 202..) are names item_itemcraft :s
     
  26. @FrozenBrain

    Any idea, when data-values will be supported by CraftGroup?
    Or does it work with subtypes, yet?
    (Log, Log:1, Log:2; 351, 351:1 ... 251:15)
     
  27. Offline

    FrozenBrain

    Both will work in 0.3.0, data values and ItemCraft. It's almost ready, all I need to do is test it for bugs.
     
  28. Offline

    morizuki

    does this need a BukkitContrib Client? or just a server?
     
  29. Offline

    FrozenBrain

    Just the server-side plugin.
     
    morizuki likes this.
  30. Offline

    Lirycs78

    VERY VERY GOOD NEWS, because with itemcraft, none plugin works :'( only for block but not for item :(
     

Share This Page