[ADMN/SEC] BanRecipe - Prevent a crafting recipe from being used - Moved to BukkitDev

Discussion in 'Inactive/Unsupported Plugins' started by Relick, Aug 18, 2011.

  1. Offline

    Relick

    This project has been moved to BukkitDev. Please use that page instead of this one!
    http://dev.bukkit.org/server-mods/banrecipe/




    BanRecipe

    Version: v0.4

    BanRecipe is a plugin designed to stop certain people from using certain recipes. It is designed as an improvement over other plugins such as NoCraft, as this plugin allows for permission group specific banning.

    Dependencies:
    Spout Server Plugin - Required (It doesn't require your users to have the launcher, don't worry)
    SuperPerms Manager - Not required, but greatly improves functionality

    Features:
    * Two modes, Permissions mode and Op mode.
    * Permissions mode allows you to block recipes per group, or even user!
    * Op mode allows you to block everyone from recipes, but Ops are exempt!
    * Does not affect the ability to have or spawn the item, only craft it. Very useful for RP servers with group specific traits.
    * Customisable message sent to user trying to craft.
    * SuperPerms support.

    Make sure to read up on how to use the plugin before you download!

    <Edit by Moderator: Redacted bit url>
    Direct Download


    Show Spoiler
    By default when you first start up the plugin, you will be placed in this mode.

    In permissions mode, there is a permission node laid out like this:
    Code:
    banrecipe.<id>: true/false
    
    Replace <id> with the item id number.

    When someone crafts something, the plugin checks if the permission for the crafted item is set to true for that player. If they don't have it, or it is set as false, it stops them from crafting, if they do it allows them to.

    Due to the sheer amount of items, it is recommended that you use the following permission:
    Code:
    banrecipe.*: true
    
    Then block items by using this permission after the above one (in this example it is id 46 for tnt):
    Code:
    banrecipe.46: false
    
    So it should now look like:
    Code:
    banrecipe.*: true
    banrecipe.46: false
    
    The user can then craft everything, except for tnt.




    Show Spoiler
    If you don't have a SuperPerms manager, or you don't require the extra functionality, you can set UsePermissions as false to switch to this mode.
    In this mode, Ops can craft everything.
    Everyone else will be blocked from crafting the ids set in config.yml
    An example of blocked tnt and flint and steel is provided when you first startup the plugin, however it is explained here:
    Code:
    ids:
        '46': true
    
    config:
        BanMessage: You cannot craft that!
        UsePermissions: false
    
    This will ban TNT, and anyone trying to craft it will recieve a message saying 'You cannot craft that!'. Ops will not be blocked from crafting TNT.




    Show Spoiler
    Code:
    ids:
        '46': true
    
    config:
        BanMessage: You cannot craft that!
        UsePermissions: false
    
    ids: Contains the ids that are blocked (op mode only)
    BanMessage: The message sent to the player if the item they are trying to craft is blocked. Remove this line entirely if you don't want a message displayed.
    UsePermissions: true/false. True will put the plugin in Permissions mode, false will put it in Op mode. Anything else will break the plugin! Removing this line will reset the config to the default settings.




    Planned Features:
    * Remove Spout dependency.
    * Furnace support

    Changelog:

    Version 0.4
    * Changed from Permissions 3 to SuperPerms

    Version 0.3
    * (Hopefully) fixed permissions mode.

    Version 0.2
    * Added some extra error handlers. It is highly recommended you update to this version.


    Show Spoiler
    Version 0.1
    * Initial release


    Special Thanks:


    @Afforess and the rest of the @SpoutDev - Greatly helped with this project.
    Everyone else who helped in the thread I posted regarding help :p
     
    Last edited by a moderator: Feb 21, 2017
    Rellac likes this.
  2. Offline

    Rellac

    I love you. :)

    Ok, should I be unable to restrict items? It seems I can restrict the use of any kind of block creation, but, for example, an iron sword doesn't seem to be able to be restricted. The main reason I was looking for a plugin like this was to make armour/weapon/tool creation specific to a blacksmith class.

    @Relick

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

    Relick

    That's odd, I just tested it, and it blocked creating an iron sword fine. Can you try redownloading, I may of mucked the download up earlier.

    Also can you check over your permissions?
    For the iron sword, the Blacksmith should have this permission:
    Code:
    - banrecipe.*
    and everyone else should have
    Code:
    - banrecipe.*
    - -banrecipe.block.267
    I think I'm going to go over how you write the permissions, it's really confusing at the moment.
     
  4. Offline

    Rellac

    @Relick

    I seem to be getting this error whenever I try to craft after updating both banrecipe and spout:

    Code:
    [SEVERE] Could not pass event CUSTOM_EVENT to BanRecipe
    java.lang.NullPointerException
        at com.relick.banrecipe.InventoryListen.onInventoryCraft(InventoryListen.java:21)
        at org.getspout.spoutapi.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.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:264)
        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)
    2011-08-18 15:06:52 
     
  5. Offline

    Relick

    I figured it out after a lot of testing. You only get that error if you are trying to craft nothing (nothing in crafting box or invalid recipe). At least for me anyway. I'll see if I can get a handler on that error.

    Does it throw that error every time you craft something though? And can you try just dragging the item or are you doing that already? Does it stop the plugin from working?

    Added the error handlers. Updated to 0.2. @Rellac , can you try it for me now please?

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

    Rellac

    Wonderful!

    Turns out the error was from the situation as you explained, and it wasn't working due to some shoddy permissions work on my end.

    Have some memes:[diamond][diamond]

    PS. nice name. ;)
     
  7. Offline

    Relick

    Thanks, for both :).
     
  8. Offline

    Rellac

    @Relick

    Hmm... Sorry, but it seems whenever I try to do "banrecipe.* nothing happens. At all. When I try "-banrecipe.*" however, every item will be blacklisted, but it's impossible to have them whitelisted again.

    Here's an example of a permissions node I have:

    Code:
            - banrecipe.*
            - -banrecipe.block.27
            - -banrecipe.block.28
            - -banrecipe.block.345
            - -banrecipe.block.347
            - -banrecipe.block.356
            - -banrecipe.block.76
            - -banrecipe.block.46
            - -banrecipe.block.355
            - -banrecipe.block.45
            - -banrecipe.block.47
            - -banrecipe.block.261
            - -banrecipe.block.262
    The listed items are supposed to be blocked from being crafted. However, with this setup, anything can be crafted.

    I've also tried the following:

    Code:
            - -banrecipe.*
            - banrecipe.block.27
            - banrecipe.block.28
            - banrecipe.block.345
            - banrecipe.block.347
            - banrecipe.block.356
            - banrecipe.block.76
            - banrecipe.block.46
            - banrecipe.block.355
            - banrecipe.block.45
            - banrecipe.block.47
            - banrecipe.block.261
            - banrecipe.block.262
    
    With this setup, everything is blacklisted, with no exceptions.

    I'm assuming there's something wrong with the individual item banning.
     
  9. Offline

    Relick

    I went through and tested what you said.
    You are right, and I'll try and fix this for 0.3.

    EDIT: Ok, updated to 0.3.

    Fixed up permissions (hopefully).
    Permission node is now laid out like this:

    - banrecipe.<id>

    Replace <id> with the id number.

    @Rellac , I'm going on holiday now for 2 weeks, so hopefully this build fixes your problem. If not, you'll unfortunately have to wait until I get back to have it fixed. Sorry about all the problems you've been having :(

    @Rellac - I tested it out again with the two configs you posted earlier (obviously changed to the new format), they now work for me.
    Can you get back to me about if you can get it to work or not?

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

    Rellac

    Works wonders.:D
     
  11. Offline

    Rellac

    @Relick

    Any chance of furnace support? Would be nice to remove Charcoal. It's VERY cheap. And have bars specific to blacksmiths.
     
  12. Offline

    Soviet Ostrich

    is it possible to ban reverse recepies, like i want to let people build gold structures but i dont them crafting the gold blocks into gold ingots and making tools, same thing with diamond blocks. if that makes any sence ;)
     
  13. Offline

    alfskan

    is it supports furnace?
     
  14. Offline

    Relick

    Yes. Simply set gold bars as the blocked item, as you cannot craft them any other way than converting a gold block.

    Also I'll look into furnace support as soon as I get back.
     
  15. Offline

    Kenshin

    ANy date for superperms ?
     
  16. Please say this plugin works with furnaces, too!
     
  17. Offline

    jungalist81

    I requested a plugin for this idea awhile ago. Im glad someone worked on it!
     
  18. Offline

    alfskan

    please furnace! when will you comeback..dont abandon it please!
     
  19. Offline

    Relick

    I was only on holiday, don't worry :p.

    There is no furnace support at the moment. I'm looking into it.

    Superperms will be in next release :).
     
  20. Offline

    alfskan

    OMG! I`m so worried about you.:'(

    Your plugin is saving my sever. now and forever!:D

    Where is donate button?

    I just gave you internet(?)

    can you support custom recipe at near future(http://forums.bukkit.org/threads/mi...urnace-recipes-1060.15685/page-12#post-522008)?:rolleyes:

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

    Relick

    It's possible but I won't implement it into this plugin directly. If there is enough demand I'll make it a separate plugin.
     
  22. Offline

    Rellac

    Ooh, I'd like this. :D
     
  23. Offline

    Relick

    Unfortunately, it will have to replace Permissions 3 if anyone still uses it (like me :(). Unlike my other plugins this one is just too difficult to use both Perms 3 and SuperPerms.
     
  24. Offline

    Rellac

    It seems to whole Bukkit comminuty is porting over. I think it's safe to say Permissions 3 is dieing.

    And yes, I still use Permissions 3 myself. Can't port over until I have this. :(
     
  25. Offline

    RugRats

    OMG.. I thought the same thing. Just usepermissions EX it's easy yesterday I was using permissions 3 and then I used turned the permissions 3 in permissions 2 format and then followed the conversion instructions with permissions ex in console set up the prefixes and suffixes chat colors ect.. It's much easier then permissions 3 and much better just try it.. i'm so happy that I can finally use all the plugins that no longer support 3.x. Fail paragraph, I know i'm in a rush..
     
  26. Offline

    Relick

    @Rellac @alfskan @RugRats @Kenshin
    I've updated to 0.4. This is exactly the same as 0.3, but with SuperPerms instead of Permissions 3.

    Furnace support is still being added.

    Also, as soon as the next version is ready, this plugin will be moved to BukkitDev. Hope you all can carry on the support there.
     
  27. Offline

    alfskan

    Oh...no.....

    You mean removed permissions 3.x support..?

    If so.. I cant use it anymore...

    Why..:'(
     
  28. Offline

    Relick

    Do you really need it to be readded? I think I've got it figured out if you need it.
     
  29. Offline

    alfskan

    My server based on 2 plugins.

    One is Heroes and another is yours.

    But Heroes doesnt support superperms yet, they're working on it.

    One of our important job is based on your plugin. The crafter.

    So..I really want it..:'(
     
  30. Offline

    Relick


    Well at the moment no features have been added for 0.4, so you could carry on using 0.3 until Heroes upgrades. Also, have you tried SuperPermsBridge?
     

Share This Page