summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
diff options
context:
space:
mode:
authorementalo <ementalodev@gmx.co.uk>2013-02-28 21:02:37 +0000
committerementalo <ementalodev@gmx.co.uk>2013-02-28 21:02:37 +0000
commit8d77a3f941606f01b8aa63651a28fd3a127360ed (patch)
tree1d4a394b2f60f5760b12aa03872aa7a0b39f8811 /EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
parent58b1b34e4442f342af34b10876e7e7097499b15b (diff)
downloadEssentials-8d77a3f941606f01b8aa63651a28fd3a127360ed.tar
Essentials-8d77a3f941606f01b8aa63651a28fd3a127360ed.tar.gz
Essentials-8d77a3f941606f01b8aa63651a28fd3a127360ed.tar.lz
Essentials-8d77a3f941606f01b8aa63651a28fd3a127360ed.tar.xz
Essentials-8d77a3f941606f01b8aa63651a28fd3a127360ed.zip
[Breaking] Remove protect database functionality for protecting signs and rails.
- Removed config entries - Removed c3p0 lib
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java52
1 files changed, 0 insertions, 52 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
deleted file mode 100644
index 9236213d5..000000000
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.earth2me.essentials.protect;
-
-import static com.earth2me.essentials.I18n._;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
-import org.bukkit.block.Block;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-import org.bukkit.event.block.Action;
-import org.bukkit.event.player.PlayerInteractEvent;
-
-
-public class EssentialsProtectPlayerListener implements Listener
-{
- private final IProtect prot;
- private final IEssentials ess;
-
- public EssentialsProtectPlayerListener(final IProtect prot)
- {
- this.prot = prot;
- this.ess = prot.getEssentialsConnect().getEssentials();
- }
-
- @EventHandler(priority = EventPriority.LOW)
- public void onPlayerInteract(final PlayerInteractEvent event)
- {
- // Do not return if cancelled, because the interact event has 2 cancelled states.
- final User user = ess.getUser(event.getPlayer());
-
- if (user.isAuthorized("essentials.protect.ownerinfo") && event.getAction() == Action.RIGHT_CLICK_BLOCK)
- {
- final StringBuilder stringBuilder = new StringBuilder();
- boolean first = true;
- final Block blockClicked = event.getClickedBlock();
- for (String owner : prot.getStorage().getOwners(blockClicked))
- {
- if (!first)
- {
- stringBuilder.append(", ");
- }
- first = false;
- stringBuilder.append(owner);
- }
- final String ownerNames = stringBuilder.toString();
- if (ownerNames != null && !ownerNames.isEmpty())
- {
- user.sendMessage(_("protectionOwner", ownerNames));
- }
- }
- }
-}