Limit plugins to certain worlds!
PerWorldPlugins v1.2+ was built with compatibility as a top priority. Because of this, we should be fully functional with other plugins. However, in the case that you do stumble upon an incompatibility, we urge you to create an informative ticket!
Plugin Creator: MylesC
Plugin Maintainer: Incomprehendable
PerWorldPlugins will inject the Bukkit core with its own CommandMap as well as changing how the event system works using some neat (and totally not hacky in any way) tricks. This allows you to control which plugins receive the events needed to function, and more importantly, where they receive those events. Using this plugin, you can block plugins in certain worlds. If you're hosting a hybrid server, you're probably overflowing with excitement. Sick of people using mcMMO in your minigames? Block mcMMO in the minigames world! Don't like LWC in your hardcore world? Block that, too!
We've updated our plugin to provide maximum compatibility, If you need the technical know-how, we've pushed the changes to our GitHub below. The biggest step in this update is the fact that we have stopped overriding Bukkit's PluginManager, meaning that all plugins should be compatible.
This is an example of the config.
limit: WorldEdit: - world - world_nether ModReq: []
The configuration of PerWorldPlugins is simple and easy. Referring to the example above, WorldEdit would only work in the worlds 'world' and 'world_nether'. However, ModReq will work in any world.
REMEMBER: If a plugin has no world list, it will work in every world.
exempt-login-events is a self-explanatory feature. This controls whether or not PerWorldPlugins will allow login events to work in every world, no matter the limits. This is highly recommended to be true. It will cause some memory leaks. For example, most minigames plugins will save a player's inventory, so when they log out and log in, their inventory will be returned. If they return to a world that blocks the minigames plugin and this boolean is set to false, their inventory will be lost. Forever.
blocked-msg is also self-explanatory. This is just the string that is sent to players when they try a command from a plugin that is blocked in their current world. And no, there was no way to explain that easier.
You can also use these variables in the string:
API: Currently we don't support one. If you want one, suggest the features you want!
If your plugin is incompatible, it is mainly because the plugin might extend to SimplePluginManager. PerWorldPlugins will not extend to that class due to its protection; how can you expect us to do so without some more l33t hacky code manipulation?
Here's an example on how to fix it:
Before: (incompatible)
SimplePluginManager spm = (SimplePluginManager)Bukkit.getServer().getPluginManager(); Field scmF = spm.getClass().getDeclaredField("commandMap");
After: (compatible!)
PluginManager pm = Bukkit.getServer().getPluginManager(); Field scmF = pm.getClass().getDeclaredField("commandMap");
Done! That's it. Even as a bonus, if someone decides to make another PluginManager, your plugin will already work with it.
For russian https://www.youtube.com/watch?v=j-mWlh1zMyM
/pwp version - Displays the version of the plugin.
/pwp reload - Reloads the config.
pwp.admin - Gives access to reload and view the plugin's version.
YourKit supports this project with its full-featured Java Profiler.
YourKit, LLC is the creator of YourKit Java Profiler
and YourKit .NET Profiler,
innovative and intelligent tools for profiling Java and .NET applications. We use it on this project to allow us optimise it for best experience.
