From f46948249e881688ead76add5478716bd410780e Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 21 Feb 2012 17:33:46 +0100 Subject: Updated Essentials to work with R5 --- .../essentials/protect/EmergencyBlockListener.java | 36 ---------------------- .../protect/EmergencyEntityListener.java | 22 ------------- .../protect/EmergencyPlayerListener.java | 16 ---------- .../essentials/protect/EssentialsProtect.java | 19 ++---------- .../protect/EssentialsProtectEntityListener.java | 2 +- 5 files changed, 3 insertions(+), 92 deletions(-) delete mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java delete mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java delete mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java (limited to 'EssentialsProtect') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java deleted file mode 100644 index 7ff17b381..000000000 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.earth2me.essentials.protect; - -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockBurnEvent; -import org.bukkit.event.block.BlockFromToEvent; -import org.bukkit.event.block.BlockIgniteEvent; -import org.bukkit.event.block.BlockListener; - -@Deprecated -public class EmergencyBlockListener extends BlockListener -{ - - @Override - public void onBlockBurn(final BlockBurnEvent event) - { - event.setCancelled(true); - } - - @Override - public void onBlockIgnite(final BlockIgniteEvent event) - { - event.setCancelled(true); - } - - @Override - public void onBlockFromTo(final BlockFromToEvent event) - { - event.setCancelled(true); - } - - @Override - public void onBlockBreak(final BlockBreakEvent event) - { - event.setCancelled(true); - } -} diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java deleted file mode 100644 index 08b04aae1..000000000 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.earth2me.essentials.protect; - -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntityListener; - -@Deprecated -public class EmergencyEntityListener extends EntityListener -{ - - @Override - public void onEntityExplode(final EntityExplodeEvent event) - { - event.setCancelled(true); - } - - @Override - public void onEntityDamage(final EntityDamageEvent event) - { - event.setCancelled(true); - } -} diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java deleted file mode 100644 index 169e9af79..000000000 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.earth2me.essentials.protect; - -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerListener; - -@Deprecated -public class EmergencyPlayerListener extends PlayerListener -{ - - @Override - public void onPlayerJoin(PlayerJoinEvent event) - { - event.getPlayer().sendMessage("Essentials Protect is in emergency mode. Check your log for errors."); - } - -} diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index af80647a6..9c257662d 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -9,8 +9,6 @@ import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; import org.bukkit.entity.Player; -import org.bukkit.event.Event.Priority; -import org.bukkit.event.Event.Type; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -65,21 +63,8 @@ public class EssentialsProtect extends JavaPlugin implements IProtect private void enableEmergencyMode(final PluginManager pm) { - //final EmergencyListener emListener = new EmergencyListener(); - //pm.registerEvents(emListener, this); - - //TODO: Remove deprecated listners in a few weeks. - - final EmergencyBlockListener emBlockListener = new EmergencyBlockListener(); - final EmergencyEntityListener emEntityListener = new EmergencyEntityListener(); - final EmergencyPlayerListener emPlayerListener = new EmergencyPlayerListener(); - pm.registerEvent(Type.PLAYER_JOIN, emPlayerListener, Priority.Low, this); - pm.registerEvent(Type.BLOCK_BURN, emBlockListener, Priority.Low, this); - pm.registerEvent(Type.BLOCK_IGNITE, emBlockListener, Priority.Low, this); - pm.registerEvent(Type.BLOCK_FROMTO, emBlockListener, Priority.Low, this); - pm.registerEvent(Type.BLOCK_BREAK, emBlockListener, Priority.Low, this); - pm.registerEvent(Type.ENTITY_DAMAGE, emEntityListener, Priority.Low, this); - pm.registerEvent(Type.ENTITY_EXPLODE, emEntityListener, Priority.Low, this); + final EmergencyListener emListener = new EmergencyListener(); + pm.registerEvents(emListener, this); for (Player player : getServer().getOnlinePlayers()) { diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 40167ec41..57302517f 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -328,7 +328,7 @@ public class EssentialsProtectEntityListener implements Listener } @EventHandler(priority = EventPriority.HIGHEST) - public void onEndermanPickup(EndermanPickupEvent event) + public void onEntityChangeBlock(EntityChangeBlockEvent event) { if (event.isCancelled()) { -- cgit v1.2.3