CraftingManager help (replacement?)

Discussion in 'Plugin Development' started by Relick, Aug 8, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Relick

    I've been trying to stop people from using certain recipes (as in, an RP sense where a certain race cannot produce a certain substance). NoCraft does this great, but unfortunately it works for everyone rather than being able to do permission groups. I have been trying to get it to work for a while, but I've noticed the problem being that CraftingManager is used to block the recipes and this is an original minecraft server class. No javadoc or explanation to it means I can't figure out how to limit it to certain players with different sets per group.

    I thought maybe listening to when an inventory was opened and change it according to the player as they open it, however this would be very ugly and may crash servers with large numbers. I also heard somewhere that another plugin used a 'pseudo' version of CraftingManager which could be the answer. Any help?
     
  2. Offline

    Baummann

    Use BukkitContrib's onInventoryCraft
     
  3. Offline

    Relick

    I'd rather not use BukkitContrib (as I as a server owner as well as a plugin developer know how frustrating it is to get people to install BukkitContrib, let alone know how to do so), however if that is the only way I guess I'll have to make do.
     
  4. Offline

    Lolmewn

    I thought you didnt need to client-side one per-se, only optional.
     
  5. Offline

    Tster

    Look at no craft source?
     
  6. Offline

    Relick

    Yeah, but for the inventory to be detected to be opened surely they need the mod otherwise it wouldn't be a feature in BukkitContrib, right? I haven't looked at it enough to know any full advantages of using it as server only.

    Also, I don't understand you Tster.

    Is this onInventoryCraft in Spout, does anyone know. Technically it is the successor, and also looks a hell of a lot more user friendly so I am a lot more interested.

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

    4am

    Don't use BukkitContrib, it's "dead". Actually, it's just been renamed "Spout"; if you use BukkitContrib at this point it'll be an old version.

    Also, Spout, liek BukkitContrib, doesn't require a client mod. Many plugins run them w/o the client mod end of it. Inventory is tracked server-side to prevent cheats (with limited success...). Spout/BukkitContrib provides inventory hooks that Bukkit itself doesn't have. No client mod required. (AFAIK)
     
  8. Offline

    Relick

    Yeah I noticed about the spout BC transition. Thanks for the info. I'll see what I can do, and carry on from there (possibly coming back to this thread).
     
  9. Offline

    Afforess

    You guys can always tag us if you want specific help. ;) We don't always stumble on Spout related threads.

    The Spout inventory listener is ALL server side, and dead simple to use. Every event can be cancelled, altered, etc. You create an inventory listener class that extends SpoutAPI's InventoryListener, register that listener as a custom event on enable, and override the methods (like onInventoryCraft) in the listener you created.

    If you need more specific help, tag @SpoutDev in a post. ;)
     
  10. Offline

    4am

    I think he means see how NoCraft does it, and then modify it so when the blocking occurs it checks for a permission node/config setting and determines if it should block based on that.
     
  11. Offline

    Relick

    Ah, that makes sense. Yeah the NoCraft source was what I was already looking at, that uses CraftingManager. Obviously it runs into the problem I'm trying to fix.

    Thanks @Afforess, that clears things up.
     
  12. Offline

    Rellac

    Any Progress? :)

    I'd LOVE to see this. There are plugins out there, but they're buggy to hell and have no support whatsoever.

    It would be nice to have something I can actually use.:)
     
  13. Offline

    Relick

    Unfortunately not. It works for stuff crafted in the Inventory (2x2) but stuff on the crafting table still gets through.
    There is a CraftingInventory interface that looks like it would work, however I'm not sure how to utilise it.
    @SpoutDev , would anyone be kind enough to explain how I would go about using the CraftingInventory interface? Or is this a client only feature?

    Hang on, it does work, but only with shapeless recipes >.<
    What am I doing wrong?

    @Rellac , @SpoutDev ,

    It does work! I have no idea what was wrong. I'll get it into a fully functional plugin as soon as I can.

    http://forums.bukkit.org/threads/ad...e-from-being-used-1060-permissions-3-x.32206/

    There you go :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
Thread Status:
Not open for further replies.

Share This Page