diff options
4 files changed, 40 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 66d53299b..97c5070b5 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.bukkit.ChatColor; +import org.bukkit.event.Event.Priority; public interface ISettings extends IConf @@ -148,4 +149,6 @@ public interface ISettings extends IConf boolean registerBackInListener(); public boolean getDisableItemPickupWhileAfk(); + + public Priority getRespawnPriority(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 25b32d544..d374e5130 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -7,6 +7,7 @@ import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.ChatColor; +import org.bukkit.event.Event.Priority; import org.bukkit.inventory.ItemStack; @@ -86,7 +87,7 @@ public class Settings implements ISettings { return config.getInt("oversized-stacksize", 64); } - + @Override public int getDefaultStackSize() { @@ -566,7 +567,7 @@ public class Settings implements ISettings { return config.getBoolean("world-teleport-permissions", false); } - + @Override public boolean registerBackInListener() { @@ -578,4 +579,31 @@ public class Settings implements ISettings { return config.getBoolean("disable-item-pickup-while-afk", true); } + + @Override + public Priority getRespawnPriority() + { + String priority = config.getString("respawn-listener-priority", "normal").toLowerCase(Locale.ENGLISH); + if ("lowest".equals(priority)) + { + return Priority.Lowest; + } + if ("low".equals(priority)) + { + return Priority.Low; + } + if ("normal".equals(priority)) + { + return Priority.Normal; + } + if ("high".equals(priority)) + { + return Priority.High; + } + if ("highest".equals(priority)) + { + return Priority.Highest; + } + return Priority.Normal; + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index f7851714e..460997345 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -514,7 +514,7 @@ protect: ############################################################ # +------------------------------------------------------+ # -# | New Players | # +# | Essentials Spawn / New Players | # # +------------------------------------------------------+ # ############################################################ @@ -529,4 +529,9 @@ newbies: # Set to "none" if you want to use the spawn point of the world. spawnpoint: newbies +# Set this to lowest, if you want Multiverse to handle the respawning +# Set this to normal, if you want EssentialsSpawn to handle the respawning +# Set this to highest, if you want to force EssentialsSpawn to handle the respawning +respawn-listener-priority: normal + # End of File <-- No seriously, you're done with configuration. diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java index ad42f9dee..c4cd7c727 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java @@ -38,7 +38,7 @@ public class EssentialsSpawn extends JavaPlugin ess.addReloadListener(spawns); final EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener(ess, spawns); - pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, Priority.Low, this); + pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, ess.getSettings().getRespawnPriority(), this); pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Low, this); LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); |