[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

    p000ison

    Yeah thx
    I've fixed lockcraft but now.xDD

    Yeah thx thx thx and thx!! ;)

    I would donate but I haven't a paypal account sry




    MfG p000ison
     
  3. Offline

    MrFloppemz

    Thank you so much for this.
     
  4. Offline

    FrozenBrain

    You're welcome :)
     
  5. Offline

    Milchshakee

    Nice work..but i get this error when i start the server:
    Code:
    2011-07-11 14:03:22 [INFO] [CraftGroup] v0.1 enabled.
    2011-07-11 14:03:22 [INFO] [CraftGroup] Found and will use plugin Permissions v3.1.5
    2011-07-11 14:03:22 [SEVERE] Error occurred while enabling CraftGroup v0.1 (Is it up to date?): java.lang.Integer cannot be cast to java.lang.String
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at de.frozenbrain.CraftGroup.cgPlugin.parseList(cgPlugin.java:146)
        at de.frozenbrain.CraftGroup.cgPlugin.loadConfig(cgPlugin.java:87)
        at de.frozenbrain.CraftGroup.cgPlugin.onEnable(cgPlugin.java:62)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:857)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:264)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:151)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:136)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:358)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:281)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:298)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:711)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:676)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:669)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
        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)
    My config:
    Code:
    global-blacklist:
    - TNT
    Farmer:
    - 5
    - 22
    - 23
    - 24
    - 26
    - 41
    - 42
    - 43
    - 44
    - 45
    - 46
    - 47
    - 57
    - 66
    - 67
    - 69
    - 70
    - 72
    - 76
    - 77
    - 85
    - 89
    - 96
    - 256
    - 257
    - 258
    - 267
    - 269
    - 270
    - 271
    - 272
    - 273
    - 274
    - 275
    - 276
    - 277
    - 278
    - 279
    - 283
    - 284
    - 285
    - 286
    - 306
    - 307
    - 308
    - 309
    - 310
    - 311
    - 312
    - 313
    - 314
    - 315
    - 316
    - 317
    - 322
    - 325
    - 330
    - 333
    - 336
    - 324
    - 343
    - 347
    - 355
    - 356
    Schmied:
    - 22
    - 23
    - 24
    - 35
    - 46
    - 57
    - 67
    - 70
    - 76
    - 77
    - 89
    - 282
    - 297
    - 339
    - 340
    - 342
    - 343
    - 350
    - 351
    - 353
    - 354
    - 356
    - 357
    Hunter:
    - 5
    - 22
    - 23
    - 24
    - 27
    - 28
    - 35
    - 41
    - 42
    - 44
    - 45
    - 46
    - 47
    - 53
    - 57
    - 61
    - 66
    - 67
    - 69
    - 70
    - 72
    - 76
    - 77
    - 85
    - 89
    - 96
    - 256
    - 257
    - 258
    - 261
    - 262
    - 267
    - 269
    - 270
    - 271
    - 272
    - 273
    - 274
    - 275
    - 276
    - 277
    - 278
    - 279
    - 281
    - 282
    - 283
    - 284
    - 286
    - 290
    - 291
    - 292
    - 293
    - 294
    - 297
    - 306
    - 307
    - 308
    - 309
    - 310
    - 311
    - 312
    - 313
    - 314
    - 315
    - 316
    - 317
    - 322
    - 325
    - 328
    - 330
    - 333
    - 336
    - 339
    - 340
    - 342
    - 343
    - 347
    - 350
    - 351
    - 353
    - 354
    - 355
    - 356
    - 357
    Miner:
    - 5
    - 35
    - 41
    - 42
    - 45
    - 46
    - 47
    - 53
    - 85
    - 96
    - 256
    - 257
    - 258
    - 261
    - 262
    - 267
    - 271
    - 275
    - 276
    - 277
    - 278
    - 279
    - 281
    - 282
    - 283
    - 284
    - 285
    - 286
    - 290
    - 291
    - 293
    - 294
    - 297
    - 306
    - 307
    - 308
    - 309
    - 310
    - 311
    - 312
    - 313
    - 314
    - 315
    - 316
    - 317
    - 322
    - 325
    - 330
    - 333
    - 336
    - 339
    - 340
    - 347
    - 350
    - 353
    - 354
    - 355
    - 319
    **EDIT** If I delete the config and try to change it ingame, there occour no errors but there are no effects...so everybody can craft everything.
     
  6. Offline

    FrozenBrain

    @Milchshakee Uploaded a fixed version. Thought I could cast an Integer to a String :D

    Please try that one and make sure BukkitContrib is running properly.
     
  7. Offline

    Milchshakee

    @FrozenBrain ok...now there are no errors..but everybody can still craft anything. I checked everything.
    My config:
    Code:
    global-blacklist:
    - TNT
    Farmer:
    - 5
    - 22
    - 23
    - 24
    - 26
    - 41
    - 42
    - 43
    - 44
    - 45
    - 46
    - 47
    - 57
    - 66
    - 67
    - 69
    - 70
    - 72
    - 76
    - 77
    
    My permissions:
    - craftgroup.group.Farmer
    Gobal blacklist works...but not a specific group.
     
  8. Offline

    FrozenBrain

    @Milchshakee Uploaded 0.1.2. That was just a small issue with case-sensitive groupnames. Sorry 'bout that :/
     
  9. Offline

    Milchshakee

    Thx now it works :D
     
  10. Offline

    NeatMonster

    Code:
    [INFO] [CraftGroup] Unknown Material "MODLOADERMP_ITEM", ignoring.
    Can you make it compatible with ModLoaderMP for CraftBukkit? I need to disable the IndustrialCraft coins.
     
  11. awesome guy.


    but can you make crafting levelbare ore buyable?

    maybe

    you can block block destructuion, too?
     
  12. Offline

    p000ison

    18:30:22 [SCHWERWIEGEND] Could not pass event CUSTOM_EVENT to CraftGroup
    java.lang.NoSuchMethodError: com.nijiko.permissions.PermissionHandler.getUserObj
    ect(Ljava/lang/String;Ljava/lang/String;)Lcom/nijiko/permissions/User;
    at de.frozenbrain.CraftGroup.cgPlugin.mergeGroups(cgPlugin.java:116)
    at de.frozenbrain.CraftGroup.cgPlugin.canCraft(cgPlugin.java:132)
    at de.frozenbrain.CraftGroup.Listener.cgInventoryListener.onInventoryCra
    ft(cgInventoryListener.java:26)
    at org.bukkitcontrib.event.inventory.InventoryListener.onCustomEvent(Inv
    entoryListener.java:41)
    at org.bukkit.plugin.java.JavaPluginLoader$84.execute(JavaPluginLoader.j
    ava:834)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:321)
    at org.bukkitcontrib.ContribNetServerHandler.a(ContribNetServerHandler.j
    ava: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:84)
    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)
    Does it works wit Groupmanager or is it another error?
    The config is the default.
     
  13. Offline

    Crash

    Good to see somebody picked up my idea people kept messaging me about it :p
     
  14. Offline

    p000ison

    The same error if the config is empty. ;)
     
  15. Offline

    FrozenBrain

    Finally :D

    I'll see what I can do.

    You need at least Permissions 3.

    Thanks :)
    That's planned, as well as preventing people from placing and using things.

    If you don't mind, I'd like to continue your plugin :)
     
    NeatMonster likes this.
  16. Offline

    Crash

    Go ahead mine was being really weird and causing the client to crash or something.
    I don't know if it was bukkitcontribu or my plugin
     
  17. Offline

    FrozenBrain

    It's working perfectly for me, even if the config is empty.
     
  18. Offline

    NeatMonster

    Thanks, I really need this.
     
  19. Offline

    p000ison

    Can you add Groupmanager support? ;)
     
  20. Offline

    FrozenBrain

    Sorry, but BukkitContrib is not compatible with ModLoaderMP yet. Can't do much about that :/

    .. Maybe?
     
  21. Offline

    Alexbrainbox

    Hey, I'd just like to say that it's awesome you've taken up the baton effectively dropped by Crash :)

    I was wondering, is there any possibility for a whitelist option, in addition to the blacklist? Would that require a complete rewrite, or would it be a fairly simple process? If the latter, do you think you could quickly knock up a build?

    I don't mean to be a pain, but it'd be perfect for my upcoming server, and I'd happily put your name in the MOTD, give you elevated permissions, whatever you'd like :)
     
  22. Offline

    Milchshakee

    Can you add item numbers like 35:2 ?
     
  23. Offline

    FrozenBrain

    Not yet. But adding this is a great idea. Adding it to my Todo list :)
     
  24. Offline

    Masterflapdrol

    @FrozenBrain can you make that you can heve the items. but it will block you from doing it with item spawning?
    and that you can spawn the item with the console only?
     
  25. Offline

    FrozenBrain

    What do you mean by item spawning? Breaking blocks? Spawning 'em with ingame commands?
     
  26. Offline

    Masterflapdrol

    I mean from this: /i slimeball 64 or something ike that
     
  27. Offline

    FrozenBrain

    How about not giving your users the permission to use /i? Sorry, but I have no idea what you would need this function for.
     
  28. Offline

    Masterflapdrol

    but then i need to put all the other items in the permissions and dont dont use da :p
     
  29. Offline

    FrozenBrain

    Why do you give people the /i permission if you don't trust them?
    Preventing people from cheating items is not the purpose of this plugin though.
     
  30. Do you need permisssions if all you want to do is use the global blacklist?
     

Share This Page