[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

    Razherrt

    Hello Frozen, Are you going to add a permissions node to bypass just one group in the config. I need this function for the crafting classes on my server that will slowly unlock new crafting permissions as they level up.

    FAIL: I should have read that - itemID will override any sort of blacklist.
     
  3. Offline

    FrozenBrain

    @Lirycs78
    @Terra-Network.org
    Version 0.3.0 is out, with support for data values and ItemCraft. It still needs some testing, so I'll leave a link to 0.2.2 in the first post if you want to downgrade again.
     
  4. @FrozenBrain
    We will test it this week!
    Thx for update!

    If you're wondering, why it always resets your data values, don't just use '6' for normal Sapling, use '6:0' :)
    Took me 5 minutes to find the problem ^^
     
  5. Offline

    FrozenBrain

    If you're not defining a data value for saplings, every sapling will be black- or whitelisted. That's because I think that no one wants to write down all 16 colors of wool for example :D

    So yes, if you only want to black- or whitelist normal saplings, use SAPLING:0.
     
  6. @FrozenBrain
    Our Config is empty and if someone is crafting anything, there's this error:

    Code:
    2011-08-01 11:51:53 [SEVERE] Could not pass event CUSTOM_EVENT to CraftGroup
    java.lang.NullPointerException
        at de.frozenbrain.CraftGroup.Listener.cgInventoryListener.onInventoryCraft(cgInventoryListener.java:30)
        at org.bukkitcontrib.event.inventory.InventoryListener.onCustomEvent(InventoryListener.java:41)
        at org.bukkit.plugin.java.JavaPluginLoader$87.execute(JavaPluginLoader.java:855)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
        at org.bukkitcontrib.ContribNetServerHandler.a(ContribNetServerHandler.java:228)
        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:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Same with BLOCK_BREAK
     
  7. Offline

    FrozenBrain

    Thanks for reporting, fixed those NPEs in 0.3.1.
     
  8. Ok!
    Working on config-file at the moment, i think we will test it till weekend.

    Edit:
    Seems to work, thx for quick response ;)
     
  9. Offline

    Lirycs78

    Hi, thx for update but I have a problem :s
    My config :

    and, when i type /cg list in minecraft, I have this :

    [CraftGroup] global-blacklist (1 rules)
    [CraftGroup] 1 rules in group "global-blacklist"
    [CraftGroup] [CRAFT][DENY] X213

    and, when I type /cg add ... 202 , /cg add ... 203

    For id 202 :
    22:07:21 [INFO] [CraftGroup] Material "[DENY][CRAFT]X202" was added to group "gl
    obal-blacklist"

    but For id 203 :
    22:07:21 [INFO] [CraftGroup] Material "[DENY][CRAFT]X203" is already in list "gl
    obal-blacklist", ignoring.

    Then, if i enter one id in config file, for instance the id 201, all my items are blocked.
     
  10. Offline

    FrozenBrain

    Those IDs are ItemCraft items, right?

    Edit: After finally getting ItemCraft and the client mod to work correctly I had the same problem. Going to fix it now, check back later for an update.
     
  11. Offline

    Lirycs78

    Thx you for your works ;p I wait :)
     
  12. Offline

    Williamsson

    Will you be changing support from bukkitcontrib to spout?
    I hope so, since is bukkitcontrib is superseeded by Spout :3
     
  13. Offline

    Hornik_Honza

    yes, please SPOUT it!
    really would like to restrict some items so i can work with them as reward on quests so it makes them really precious, cant find any other way for it than your mod.
    thx for your work :)
     
  14. Offline

    pandapipino

    well you can still craft items when it lags the server, or the server's got reloaded?
     
  15. Offline

    po24

    Does this or will this work with Spout?
     
  16. Offline

    Williamsson

    Well, it auto-downloads bukkitcontrib, and don't know if it's so good to have both Spout and bukkitcontrib?
    Did however not see any errors when I started the server first and discovered that it auto-downloads, but I don't know for sure.
     
  17. Offline

    po24

    I'd rather the plugin author answer my question :D, no offense William.
     
  18. Offline

    excalibr23

    Having both Bukkitcontrib and spout throws my server into fits of rage. I can't use your plugin until it stops downloading bukkutcontrib.
     
  19. Offline

    Flenix

  20. Offline

    po24

    You would be my angel if you update soon.
     
    Flenix likes this.
  21. Offline

    PandaC0mmander

    Major issue:

    We installed this plugin the other day, to find it hates all other plugins. It does not do anything with the server unless you put the permission nodes in and into action. Then it destroys permissions, false book and pretty much every other plugin. I haven't got the error due to my server running smoothly without it.

    Please help,
    -Dan
     
  22. Offline

    Williamsson

    Check the server.log file, and post error here? We can't do anything without the error.
    Also, we have both permissions (3,1,6) and falsebook, amongst other plugins, and it worked fine for us.

    I'll see if I can do a quick fix to "Spout-ifie" this plugin instead of bukkitcontrib tomorrow, and post a link to it if the author approves of it. But since it is open source I guess I can freely modify the code? I am unsure though, and will speak to the author about it before I post it.
     
    dak393 likes this.
  23. Offline

    PandaC0mmander

    Okay, A few problems. One I didn't know when is started. And 2, I don't know if this is it.

    Towards the end we removed the permission nodes and as you can see the plugin ran fine.


     
  24. Offline

    alfskan

    will u support spout?
     
  25. Offline

    Williamsson

    It seems as if you are having some yml trouble, I'd suggest to run CraftGroups yml in a yaml parser (google).
    You could also run permissions yml file, since it appeared, just to be safe. But since it works without craftgroup it seems to be there the trouble is.

    Just took a quick look though, and guessed that the problems lies in this.

    you are like the thousand person asking this, I'd suggest reading the thread and you'll see that we haven't gotten any answers, and that I'll see if I can transfer it to spout.
     
  26. Offline

    po24

    Go William Go!!!
     
  27. Offline

    PandaC0mmander


    I dont know what this means, sorry :(
     
  28. Offline

    Williamsson

    The config file for CraftGroup is a yml file. Copy it, and paste it here: http://yaml-online-parser.appspot.com/
    That'll show you if there's any errors based on your yml file, for example there could be a space wrong or something.
    And you could also try the same with the permissions file.

    Hope that explains it a bit further :)
     
  29. Offline

    Kevger

    spout support please.
     
  30. Offline

    FrozenBrain

    Sorry, that it takes you so long to get an answer from me. I've barely had internet the last 3 days and believe me, I'm pissed right now.

    B2T: I couldn't get ItemCraft to work yet (pretty hard to fix, if you've got any hints, tell me pls) but I can assure you that Spout will be support in the next release. Should be ready in a few days (maybe tuesday).
     
  31. Offline

    Milchshakee

    Hm... does "Support for data values" mean, that you can add Things like 351:10 or RED_WOOL?
    Because when i add this to the blacklist it says unknown Material or something.
    What did I worng ? :eek:
     

Share This Page