Limiting a plugin

Discussion in 'Plugin Development' started by Markyroson, Mar 26, 2015.

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

    Markyroson

    Is there any way to limit portions of a plugin (with code)? If so could I possibly have a working example?


    Please and thank you! :)
     
  2. Offline

    nverdier

    @Markyroson Depends on the plugin and what you want to disable.
     
  3. Offline

    Markyroson

    a command. If you want the github page (too see complete code) here it is: https://github.com/Markyroson/MarkyCraft-All-In-One

    the command (to be specific) that would be disabled is "/mcshop" if you are outside of a pre-determined world (ie a survival world)
     
  4. Offline

    nverdier

  5. Offline

    Markyroson

    I am just trying to minimize the amount of plugins on my server and don't want to have to have ANOTHER plugin when it could just be added to the current one if at all possible.

    Too bad it isn't as simple as an if statement to limit it, if it wasn't in the correct world it simply didn't do anything or display a message telling user.

    I have tried a quick Google search but it just displays plugins that do it, not coding help on how to.
     
    Last edited: Mar 26, 2015
  6. Offline

    nverdier

    @Markyroson Well in your OP you said
    So you'd have to make a plugin...
     
  7. Offline

    Markyroson

    I do have a plugin already, I simply want to minimize the number of plugins on my server (currently 28-30ish) w/2GB RAM.

    I do have a plugin and I linked the source code (https://github.com/Markyroson/MarkyCraft-All-In-One) in my first reply to your original message as well. If it is not possible then I will use another plugin, I was just hoping there would be an easy solution that I could add to the plugin (linked above) to do it. I don't need something fancy, just something to limit that command period.

    By converting my shop from a world to a simple GUI I hope to clear up some server resources usage, the issue is that I have inventories limited per world (so that someone couldn't get blocks etc [or full diamond armor] in creative and then bring it to the survival world for building/defense etc) so it would be easiest if that particular command was limited to the one world (called Survival). Unfortunately the plugin has more than one command within it or I would just get a plugin to limit the whole thing.
     
  8. Online

    timtower Administrator Administrator Moderator

    @Markyroson Add permissions support, remove permissions for the GUI in other worlds
     
    Markyroson likes this.
  9. Offline

    Markyroson

    Thank you! That is a very good idea. I will do that.

    Wait....how would I make the player only have permissions in one world? Permissions are normally granted globally.
     
  10. Online

    timtower Administrator Administrator Moderator

    @Markyroson Most permissions plugin have world based permissions hidden somewhere, been a while for me since I used that, PEX and groupmanager both have it.
     
    bennie3211 likes this.
Thread Status:
Not open for further replies.

Share This Page