PerWorldPlugins

PerWorldPlugins


PerWorldPlugins

Limit plugins to certain worlds!
Plugin Creator: MylesC
Plugin Maintainer: Incomprehendable

What does this plugin do, and how does it work?

PerWorldPlugins will inject the Bukkit core with its own PluginManager and CommandMap, allowing 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!

Configuration

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:

  • %player% - The name of the player receiving the message
  • %world% - The name of the world that the player is currently in
  • %plugin% - The name of the plugin that is blocked in the world.

Developers

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.

Installation and Use

  1. Download PerWorldPlugins.
  2. Place PerWorldPlugins.jar into your plugin folder.
  3. Start up (or restart) your server.
  4. PerWorldPlugins should have created a folder, called "PerWorldPlugins". Go in there, and edit the configuration file. (server\plugins\PerWorldPlugins\config.yml)
  5. Type /pwp reload in-game, and enjoy the plugin!

Video Tutorials/Showcases

Bugs and Issues

  • PerWorldPlugins may break another plugin on reload. We haven't found any yet, but the cause of this is due to strange event registering. If it happens, just restart the server.
  • Some plugins may require a server reboot to limit. As above, this is caused by how that plugin handles its events.
  • We will probably never support plugins that use methods such as getAllPlayers() because we can't necessarily control that. Plugins that rename items may also be incompatible.
  • World-management plugins, like Multiworld or Multiverse, will cease to function properly if you limit them. If they do, do not limit them!
  • USE JAVA 7 UPDATE 60 OR HIGHER WHEN USING PWP!
  • Because it injects a customized PluginManager into the Bukkit core, PerWorldPlugins will appear during errors. This does not mean that PWP is the issue. Make sure that you can read stack traces well enough to determine whether or not the issue is from my end.

Benefits

  • Fix up and prevent certain exploits and unfair tactics in places. (like the mcMMO/Minigames example)
  • Cut down on server lag; some plugins like SurvivalGames check player movement, which fires everywhere, costing you RAM and CPU usage.
  • Add more features and plugins into your server.

Downloading


You can find the GitHub source here - https:github.com/MylesIsCool/PerWorldPlugins
You can download stable builds by looking at the Files tab at the top.

Commands


/pwp version - Displays the version of the plugin.

/pwp reload - Reloads the config.

Permissions


pwp.admin - Gives access to reload and view the plugin's version.

Developer's Server

Shameless self-advertising! If you want to join Incomprehendable's Minecraft server, you can do so below!


Sponsors


MylesC:
HostHorde.com

Incomprehendable:
GetNodeCraft.net

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of jp1997 jp1997 Jan 25, 2014 at 12:53 UTC - 0 likes

    When I put this plugin on my server, it generates this error in several plugins: http://pastebin.com/Tdq4jwNV

    "Se não sabes, aprende; Se já sabes, ensina" Confúcio

  • Avatar of ReeferX7 ReeferX7 Jan 25, 2014 at 11:15 UTC - 0 likes

    same error for me like lala1911a, v1.1.0 works fine but if i update i have this error.

  • Avatar of lala1911a lala1911a Jan 25, 2014 at 09:08 UTC - 0 likes

    PLZ HELP!!

    [10:04:02] [Server thread/ERROR]: Could not load 'plugins/PerWorldPlugins.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.Incomprehendable.PerWorldPlugins.WorldPlugins at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:308) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:231) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:255) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at org.bukkit.craftbukkit.v1_7_R1.CraftServer.<init>(CraftServer.java:233) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.PlayerList.<init>(PlayerList.java:63) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] Caused by: java.lang.ClassNotFoundException: me.Incomprehendable.PerWorldPlugins.WorldPlugins at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [?:1.7.0_45] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [?:1.7.0_45] at java.security.AccessController.doPrivileged(Native Method) [?:1.7.0_45] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [?:1.7.0_45] at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [?:1.7.0_45] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [?:1.7.0_45] at java.lang.Class.forName0(Native Method) [?:1.7.0_45] at java.lang.Class.forName(Class.java:270) [?:1.7.0_45] at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] ... 9 more

  • Avatar of TheMinecraftWandererz TheMinecraftWandererz Jan 25, 2014 at 07:34 UTC - 0 likes

    This plugin sounds good. I used to have this problem and that is why i canceled some of my worlds. May use this in the future!

  • Avatar of Incomprehendable Incomprehendable Jan 25, 2014 at 02:21 UTC - 1 like

    Lol, I'm so stupid sometimes. The reference to the main class isn't correct. To fix this error on your own, go to the plugin.yml file in the PerWorldPlugins .jar, and make sure the main: field says this:

    me.Incomprehendable.WorldPlugins.WorldPlugins
    


    I've uploaded a fix for this. You can wait for the upload to be approved or just fix it yourself. So sorry!

    Steven's Freebuild

  • Avatar of zeshan321 zeshan321 Jan 25, 2014 at 01:29 UTC - 0 likes

    Getting this error: http://pastebin.com/sNS7aLQ7 downgrading to the 1.6.4 version fixed this.

  • Avatar of Theepwner Theepwner Jan 25, 2014 at 00:59 UTC - 1 like

    Now showing up as a plugin when doing /plugins? Also /pwp is not a command? Yet the plugin still functions?

  • Avatar of Incomprehendable Incomprehendable Jan 25, 2014 at 00:18 UTC - 0 likes

    @pompy5685: Go

    @Mavhill: Go

    @TWSSYesterday: Go

    No problem! I loved PerWorldPlugins and it helped me out a lot. After I first asked MylesC if I could take over the project, I actually updated it myself and used it on my own server for awhile; couldn't live with the guilt! I asked him again, and got a response. He's the one to thank!

    @Theepwner: Go

    I don't know. I didn't test it with MCore or Factions. If it doesn't work, I'll see what I can do. Most likely, the developers of those plugins will have to adjust. Come to think of it, MCore might inject its own PluginManager into Bukkit. I can just replace it, but most likely, MCore's plugins rely on that PluginManager, so it may be difficult to allow compatibility.

  • Avatar of Mavhill Mavhill Jan 25, 2014 at 00:10 UTC - 0 likes

    @Incomprehendable: Go

    Big Thanks bro!

  • Avatar of pompy5685 pompy5685 Jan 25, 2014 at 00:06 UTC - 0 likes

    @Incomprehendable: Go

    Thaks!

Facts

Date created
Jun 12, 2013
Categories
Last update
Mar 01, 2014
Development stage
Release
Language
  • enUS
License
Public Domain
Curse link
PerWorldPlugins
Downloads
14,825
Recent files

Authors