Solved disable worlds

Discussion in 'Plugin Development' started by bronzzze, Mar 27, 2015.

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

    bronzzze

    I want to diasable plugin in worlds which are written in config. I know only how to disable events and commands but i want to disable whole plugin
    Config exemple
    HTML:
    Worlds:
    - world
    - world_end
    I hope you know what i mean
     
  2. Offline

    mine-care

    @bronzzze i think you mean you want to disable plugins for a specific world, youll need to register a custom plugin loader, and command map/handler
     
  3. Offline

    bronzzze

    Yes i want to disable plugin for specifed world. I make it like this

    If(main.config().getstring(worlds){
    If(cmd.ge....

    Or something like that and it disabled only command. So if i want to disable whole plugin i need to set plugin loader
     
  4. Offline

    Jacc734

    @bronzzze wouldn't blocking the base command of a plugin work? I am unsure what plugins exactly you are using, or if they are open source (or easy enough to edit) but you might fork a repository from the plugins Git account (if it has one) and add in the functionality that way.
     
  5. Offline

    bronzzze

    Problem is i need to make this if statment for each event(in my plugin around 10) and each command
     
  6. Offline

    Jacc734

    Could you list what plugins you are using? If there are some open source, I think there is an easier way to disable them.

    EDIT: You might trying Google your question next time before posting, regardless:

    Plugin:
    http://dev.bukkit.org/bukkit-plugins/perworldplugins/
    Youtube Review:
     
    Last edited: Mar 27, 2015
  7. Offline

    bronzzze

    I can make it so if i implement pluginloader right?
     
  8. Offline

    Protophite

    You could also use permissions per world.
     
  9. Offline

    bronzzze

    Yes but i want to disable whole plugin not only command/event. how could i do this(I dont know how to work with pluginloader)



    Edit:
    I made for each Event this string I hope it will work.
     
    Last edited: Mar 27, 2015
  10. Offline

    Jacc734

    Did you look at the link I posted up there? There are a lot of tutorials about it on the wiki/online, so if you use what I posted as a starting point it shouldn't be too hard to figure out how to the use the PerWorldPlugin... thats about the perfect solution in my mind, so if you still are confused about how to do, I don't know how to help. Best of luck resolving your problem! :)
     
  11. Offline

    MexMaster

    @Jacc734
    I don't think PerWorldPlugins can totally block plugins in certain worlds. If the plugin is just using commands and listeneners it will work, but as op said he needs more. PerWorldPlugin for example can't block bukkittasks the plugin has running in background and also can't block extra threads this plugin is starting, also things that are done to all worlds for example in onEnable can't be blocked in certain worlds
     
  12. Offline

    bronzzze

    @MexMaster I have problem now how to disable Bukkittask I blocked all commands and listeners But to finish i need to block only few tasks.
     
  13. Offline

    MexMaster

    @bronzzze
    Editing bukkittasks of other plugins may crash them. And you're sure you just want to disable bukkittasks of other plugins and not the whole plugin in a world? Because disabling the whole plugin will be impossible to do because you don't know what the plugin developer built into his plugin.
    You can cancel tasks of plugins by calling Bukkit.getScheduler().cancelTask(BukkitTask task) but you probably don't have the task instance so you won't be able do anything here. (You can cancel all tasks of a plugin by calling something like Bukkit.getScheduler().cancelTasks(Bukkit.getPluginManager().getPlugin("plugin name"));
    Something like that, but it may break the whole plugin so be aware)
     
  14. Offline

    bronzzze

    Yes problem is I have disco armour and I want to cancel task when they go to other world so they cant use disco armour on other world.
    No I dont want to disable task of other plugins. I want to disable my plugin when its on other world example I want to disable it on world_nether
     
    Last edited: Mar 27, 2015
  15. Offline

    MexMaster

    @bronzzze
    In the PlayerChangeWorld event, if the new world is world_nether just do whatever you need to stop it. If you don't understand please post your code
     
  16. Offline

    bronzzze

    ohh there is playerchangeworldevent didnt know that LOL ty dude:)
     
  17. @bronzzze If you're problem is solved, please set this thread to solved by going to Thread Tools (at the top) > Edit Title > Prefix > Solved. If not, just ignore this post. :)
     
Thread Status:
Not open for further replies.

Share This Page