diff options
author | snowleo <schneeleo@gmail.com> | 2012-01-24 00:52:08 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-01-24 00:52:08 +0100 |
commit | cc0e9aa84bc41e341f04202f1f0d2f3c402cf3f4 (patch) | |
tree | a7cbcd229b4a5c3dee2731b95b3ddc1ccd95df4c /EssentialsSpawn | |
parent | 6af054631fe04ef7a607f24e459e37836c568100 (diff) | |
parent | f93769dd1dd11ef30c77dd6c9e0e5cf275052715 (diff) | |
download | Essentials-cc0e9aa84bc41e341f04202f1f0d2f3c402cf3f4.tar Essentials-cc0e9aa84bc41e341f04202f1f0d2f3c402cf3f4.tar.gz Essentials-cc0e9aa84bc41e341f04202f1f0d2f3c402cf3f4.tar.lz Essentials-cc0e9aa84bc41e341f04202f1f0d2f3c402cf3f4.tar.xz Essentials-cc0e9aa84bc41e341f04202f1f0d2f3c402cf3f4.zip |
Merge branch 'refs/heads/master' into 3.0
The changes to EssChat have not been merged
Conflicts:
Essentials/src/com/earth2me/essentials/Essentials.java
Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
Essentials/src/com/earth2me/essentials/ISettings.java
Essentials/src/com/earth2me/essentials/OfflinePlayer.java
Essentials/src/com/earth2me/essentials/Settings.java
Essentials/src/com/earth2me/essentials/Util.java
Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java
Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java
Essentials/src/com/earth2me/essentials/listener/EssentialsPluginListener.java
Essentials/src/messages.properties
Essentials/src/messages_da.properties
Essentials/src/messages_de.properties
Essentials/src/messages_en.properties
Essentials/src/messages_es.properties
Essentials/src/messages_fr.properties
Essentials/src/messages_nl.properties
EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java
EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java
EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java
EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java
Diffstat (limited to 'EssentialsSpawn')
3 files changed, 28 insertions, 12 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java index 2e4b5eaa6..1d73ee4c1 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java @@ -9,7 +9,12 @@ import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; -import org.bukkit.event.Event.Type; +import org.bukkit.event.Event; +import org.bukkit.event.EventException; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerRespawnEvent; +import org.bukkit.plugin.EventExecutor; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -41,10 +46,22 @@ public class EssentialsSpawn extends JavaPlugin commandHandler = new EssentialsCommandHandler(EssentialsSpawn.class.getClassLoader(), "com.earth2me.essentials.spawn.Command", "essentials.", spawns, ess); final EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener(ess, spawns); - pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, spawns.getRespawnPriority(), this); - pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, spawns.getRespawnPriority(), this); - - LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); + pluginManager.registerEvent(PlayerRespawnEvent.class, playerListener, spawns.getRespawnPriority(), new EventExecutor() + { + @Override + public void execute(final Listener ll, final Event event) throws EventException + { + ((EssentialsSpawnPlayerListener)ll).onPlayerRespawn((PlayerRespawnEvent)event); + } + }, this); + pluginManager.registerEvent(PlayerJoinEvent.class, playerListener, spawns.getRespawnPriority(), new EventExecutor() + { + @Override + public void execute(final Listener ll, final Event event) throws EventException + { + ((EssentialsSpawnPlayerListener)ll).onPlayerJoin((PlayerJoinEvent)event); + } + }, this); } public void onDisable() diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 08bb4d739..21bd0d499 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -7,13 +7,13 @@ import com.earth2me.essentials.api.IUser; import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; -public class EssentialsSpawnPlayerListener extends PlayerListener +public class EssentialsSpawnPlayerListener implements Listener { private final transient IEssentials ess; private final transient SpawnStorage spawns; @@ -25,7 +25,6 @@ public class EssentialsSpawnPlayerListener extends PlayerListener this.spawns = spawns; } - @Override public void onPlayerRespawn(final PlayerRespawnEvent event) { final IUser user = ess.getUser(event.getPlayer()); @@ -61,7 +60,6 @@ public class EssentialsSpawnPlayerListener extends PlayerListener } } - @Override public void onPlayerJoin(final PlayerJoinEvent event) { final IUser user = ess.getUser(event.getPlayer()); diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java index 0c351c753..13eb1f7df 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java @@ -12,6 +12,7 @@ import java.util.Map; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.event.Event.Priority; +import org.bukkit.event.EventPriority; public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IEssentialsModule @@ -90,18 +91,18 @@ public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IE return ess.getServer().getWorlds().get(0).getSpawnLocation(); } - public Priority getRespawnPriority() + public EventPriority getRespawnPriority() { acquireReadLock(); try { - for (Priority priority : Priority.values()) + for (EventPriority priority : EventPriority.values()) { if (priority.toString().equalsIgnoreCase(getData().getRespawnPriority())) { return priority; } } - return Priority.Normal; + return EventPriority.NORMAL; } finally { unlock(); } |