[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

    Drakisban

    With the Spout Dev Build does GraftGroup work.

    @FrozenBrain could you please add armor-restriction and could you please fix the bow-restriction? That would be really nice.
     
  3. Offline

    Flenix

    Server looks good. I guess you're using this for your classes then?
    If this isn't working by the time you want your server live, I'll give you a pre-release of my private ToolBlock plugin, it doesn't do all the features of CraftGroup its just a permissions-based sword and tool use block, so your miners etc would be the only ones who get a pickaxe, and farmers the only ones with hoes. You would still need this in the long run but its a push in the right direction :) You could also use LevelCraft's woodcutting and forgery skills, if you configure it right it will stop people breaking wood or crafting without the right permissions. (In fact I think you could use that for all your skills..)




    Also as said above, try SB390 (Trying to get Spout Build as SB going... :)) - I'll be testing in a few minutes. I got sick of players always asking me for stuff and complaining, so I made a new minecraft account and "play", so gotta be subtle...
     
  4. Offline

    FrozenBrain

    So to sum the last few posts up.. it's a bug in Spout, NOT in CraftGroup?
     
  5. Offline

    Quezax

    Yep. I have tested on spout-dev B397 and everything is working fine now.
    I did ended up adding everything to the black list individually to get my config to work.

    Feature request: The ability to blacklist an entire category(craft, use, break, place) by default, so they could be re-added via permissions groups
     
  6. Offline

    Jakeob22

    @Quezax He's right! It's fixed! :D
     
  7. Offline

    Flenix

    I agree qith Quezax too, Have you tried just using a wildcard (*) so the config:
    Code:
    global-blacklist:
        break:
        - -*
        craft:
        - -*
        use:
        - -*
        place:
        - -*
    Would effectively prevent everything...


    Also, to clarify, ItemCraft is incompatible with Spout (for those who wanted support)

    HOWEVER, Support for UltraItems would be much appreciated!!
    (Ultraitems works differently, it uses a data value for all custom items, meaning without the Spoutcraft client people just see the original item, but the data value adds special effects for example damage increase. It also adds a custom texture, and would be awesome if you could support it. I'm gonna test shortly as it may work anyway now you have data values for wool, so I'll update accordingly)

    Build 401 has the same old bug. Either of you guys fancy sending me your 397? :)
    (Also which version are you using? Mine, FrozenBrain or the other guys?)

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

    FrozenBrain

    http://ci.getspout.org/ :)
     
  9. Offline

    Quezax

    CB 1240 error, Spout 403, CG 0.3.3-Dev -
    10:14:04 [SEVERE] Could not pass event CUSTOM_EVENT to CraftGroup
    java.lang.IllegalAccessError: tried to access field net.minecraft.server.ItemStack.damage from class de.frozenbrain.CraftGroup.Listener.cgInventoryListener
    at de.frozenbrain.CraftGroup.Listener.cgInventoryListener.onInventoryClick(cgInventoryListener.java:43)
    at org.getspout.spoutapi.event.inventory.InventoryListener.onCustomEvent(InventoryListener.java:54)
    at org.bukkit.plugin.java.JavaPluginLoader$96.execute(JavaPluginLoader.java:918)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at org.getspout.spout.SpoutNetServerHandler.handleInventoryClick(SpoutNetServerHandler.java:387)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:342)
    at net.minecraft.server.Packet102WindowClick.a(SourceFile:28)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)

    I am see this on the console, but not sure what is causing it. I am having a issue since 1185 where my console gets stuck until I touch it like waiting for an irq or something. So upgraded to see if this fixed it. but now getting this error. Just passing it allong.
     
  10. Offline

    p000ison

    Thanks with the latest Craftgroup dev and spout dev all works perfekt xDD
     
  11. Offline

    arnie231

  12. Offline

    Quezax

    Any ETA on an updated version of this?
    I am still getting these errors:
    23:58:01 [SEVERE] Could not pass event CUSTOM_EVENT to CraftGroup
    java.lang.IllegalAccessError: tried to access field net.minecraft.server.ItemStack.damage from class de.frozenbrain.CraftGroup.Listener.cgInventoryListener
    at de.frozenbrain.CraftGroup.Listener.cgInventoryListener.onInventoryClick(cgInventoryListener.java:43)
    at org.getspout.spoutapi.event.inventory.InventoryListener.onCustomEvent(InventoryListener.java:57)
    at org.bukkit.plugin.java.JavaPluginLoader$96.execute(JavaPluginLoader.java:918)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at org.getspout.spout.SpoutNetServerHandler.handleInventoryClick(SpoutNetServerHandler.java:387)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:342)
    at net.minecraft.server.Packet102WindowClick.a(SourceFile:28)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:500)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  13. Offline

    Anavirn

    Hi - I've got a problem with your plugin and Heroes (Skills etc) :
    When I remove a recipe for a group, the player can't take the item on the crafting table but he got the experience from the crafting. (It don't take care of the object go back to the crafting table after the player take it)
    The only solution I have is to delete this source of experience on Heroes but it's really annoying for our players...

    We are also using Spout and there is maybe a solution with their awesome api.
    I think that Spout can allow you to modify this. (and you will be the first for this kind of plugin)

    Otherwise, I want to thank you about your work : Craftgroup is so easy to use with command and it's just wonderfull ;)

    I really hope that you can fix it :rolleyes:

    Thanks in advance !
     
  14. Offline

    p000ison

    Any news for this bug?
     
  15. Offline

    Anavirn

    No...

    :mad:! ! !
     
  16. Offline

    Jakeob22

    It would be great if somebody could update this... Nobody's able to build when I enable it for their group... :/
     
  17. Offline

    Flenix

    I'm not sure about FrozenBrain but I doubt I'd look at this I'm afraid. Purely because, Heroes is a badly written plugin by arrogant developers. Yes, I use it, but that's because there is no alternative.
    They could very easily fix this on their end, which would fix it for ALL restriction plugins (so that includes Levelcraft etc) - but no, they wont, because they don't support any other plugins and scream at you for suggesting the very idea.
    Also note how they still don't have a release out for 1.8...
    These are purely my views as I am trying to get bugs fixed in this when FB is busy. He may well look into the complex method of altering the crafting table per group... but that would be long, tedious and frankly kinda pointless... Heroes could fix it in under 5 minutes by just giving the XP once the item is in your inventory which is better practice anyway.

    Can you post your config, and tell me which of the 3 "latest" versions you're using? (Mine, FB's or the other guys) - As far as I know its working fine on mine, but for me its "all or nothing" on building as a newbie anti-grief thing
     
  18. Offline

    p000ison

    Oh dear.. :'(
    But your right...
    So for example they removed most of the skills for the public in the dev builds.
    So I have to stay on bulid 700 with huge bugs.
    And yeay its the best.
     
  19. Offline

    Jakeob22

    My config:

    Show Spoiler
    Code:
    version: 13
    global-blacklist:
        break:
        craft:
        - -TNT
        - -FLINT_AND_STEEL
        use:
        place:
        - -TNT
    miner:
        break:
        - -LOG
        craft:
        - -WOOD_SWORD
        - -WOOD_SPADE
        - -WOOD_PICKAXE
        - -WOOD_AXE
        - -WOOD_HOE
        - -STONE_SWORD
        - -STONE_SPADE
        - -STONE_PICKAXE
        - -STONE_AXE
        - -STONE_HOE
        - -GOLD_SWORD
        - -GOLD_SPADE
        - -GOLD_PICKAXE
        - -GOLD_AXE
        - -GOLD_HOE
        - -DIAMOND_SWORD
        - -DIAMOND_SPADE
        - -DIAMOND_PICKAXE
        - -DIAMOND_AXE
        - -DIAMOND_HOE
        - -CACTUS
        - -SUGAR_CANE_BLOCK
        - -CROPS
        use:
        place:
    woodcutter:
        break:
        - -GOLD_ORE
        - -IRON_ORE
        - -COAL_ORE
        - -LAPIS_ORE
        - -DIAMOND_ORE
        - -GLOWING_REDSTONE_ORE
        - -REDSTONE_ORE
        - -CACTUS
        - -SUGAR_CANE_BLOCK
        - -CROPS
        craft:
        - -WOOD_SWORD
        - -WOOD_SPADE
        - -WOOD_PICKAXE
        - -WOOD_AXE
        - -WOOD_HOE
        - -STONE_SWORD
        - -STONE_SPADE
        - -STONE_PICKAXE
        - -STONE_AXE
        - -STONE_HOE
        - -GOLD_SWORD
        - -GOLD_SPADE
        - -GOLD_PICKAXE
        - -GOLD_AXE
        - -GOLD_HOE
        - -DIAMOND_SWORD
        - -DIAMOND_SPADE
        - -DIAMOND_PICKAXE
        - -DIAMOND_AXE
        - -DIAMOND_HOE
        use:
        place:
    blacksmith:
        break:
        - -GOLD_ORE
        - -IRON_ORE
        - -COAL_ORE
        - -LOG
        - -LAPIS_ORE
        - -DIAMOND_ORE
        - -GLOWING_REDSTONE_ORE
        - -REDSTONE_ORE
        - -CACTUS
        - -SUGAR_CANE_BLOCK
        - -CROPS
        craft:
        use:
        place:
    farmer:
        break:
        - -GOLD_ORE
        - -IRON_ORE
        - -COAL_ORE
        - -LOG
        - -LAPIS_ORE
        - -DIAMOND_ORE
        - -GLOWING_REDSTONE_ORE
        - -REDSTONE_ORE
        craft:
        - -WOOD_SWORD
        - -WOOD_SPADE
        - -WOOD_PICKAXE
        - -WOOD_AXE
        - -WOOD_HOE
        - -STONE_SWORD
        - -STONE_SPADE
        - -STONE_PICKAXE
        - -STONE_AXE
        - -STONE_HOE
        - -GOLD_SWORD
        - -GOLD_SPADE
        - -GOLD_PICKAXE
        - -GOLD_AXE
        - -GOLD_HOE
        - -DIAMOND_SWORD
        - -DIAMOND_SPADE
        - -DIAMOND_PICKAXE
        - -DIAMOND_AXE
        - -DIAMOND_HOE
        use:
        place:
    
     
  20. Blocking armor from being used/weared would be just awsome!
     
  21. Offline

    dadaking

    Hello, i have a question about the version of your plugin that does not use Spout, do you think to upgrade it to 1.8.1?

    I don't use spout and.

    Thanks for the answer.
     
  22. Offline

    p000ison

    CraftGroup-dev is for 1.8.1 and Spout
     
  23. Offline

    dadaking

    But he need spout. He can work without spout?

    I test it and he doesn't work :/
     
  24. Offline

    p000ison

    No, Spout is needed.
    And without it it would be much more difficult. Such like shift+click.
    So every Crafting-Restriction would user spout.
     
  25. Offline

    dadaking

    ok but spout doesn't work on my server ->

    It's the Spout that CraftGroup download, do you know how resolve it? CraftGroup doesn't download the good spout?
     
  26. Offline

    p000ison

  27. Offline

    dadaking

    I test it, but this server version of spout does not need the client side of spout? Because i don't want to use it!

    A lot of thanks or your help ;)
     
  28. Offline

    p000ison

    Yes it dont need the client side mod
     
  29. Offline

    dadaking

    Ok perfect! thank very much!!!!!!

    I have a question about a feature in craftgroup, it is possible to block a smelting recipe? Or it is an futur feature?

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

    p000ison

    Read the topic post: Prevent crafting, smelting, using, placing or breaking of items and blocks
     
  31. Offline

    dadaking

    ho ... sorry i don't see it in the default config file, i don't think to read this ... i'm stupid ... thanks ;)
     

Share This Page