summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-12-14 16:31:08 +0100
committersnowleo <schneeleo@gmail.com>2011-12-14 16:31:08 +0100
commit0155bcedb7f00726d0b2f14e612a5342322a8278 (patch)
treea490495781c26b553f719dda2b70ece6889a3605 /EssentialsProtect
parent9ab2fe54fcea6565bdfc29aa3e3c60cb07adf1b2 (diff)
downloadEssentials-0155bcedb7f00726d0b2f14e612a5342322a8278.tar
Essentials-0155bcedb7f00726d0b2f14e612a5342322a8278.tar.gz
Essentials-0155bcedb7f00726d0b2f14e612a5342322a8278.tar.lz
Essentials-0155bcedb7f00726d0b2f14e612a5342322a8278.tar.xz
Essentials-0155bcedb7f00726d0b2f14e612a5342322a8278.zip
Updated all modules to new api, some settings are still missing
Diffstat (limited to 'EssentialsProtect')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java14
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java8
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java12
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java6
4 files changed, 20 insertions, 20 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java
index 569123cd5..7f9ec44e4 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.protect;
-import com.earth2me.essentials.IConf;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
+import com.earth2me.essentials.api.IReload;
+import com.earth2me.essentials.api.IEssentials;
+import com.earth2me.essentials.api.IUser;
import com.earth2me.essentials.protect.data.ProtectedBlockMemory;
import com.earth2me.essentials.protect.data.ProtectedBlockMySQL;
import com.earth2me.essentials.protect.data.ProtectedBlockSQLite;
@@ -45,7 +45,7 @@ public class EssentialsConnect
return ess;
}
- public void alert(final User user, final String item, final String type)
+ public void alert(final IUser user, final String item, final String type)
{
final Location loc = user.getLocation();
final String warnMessage = _("alertFormat", user.getName(), type, item,
@@ -54,7 +54,7 @@ public class EssentialsConnect
LOGGER.log(Level.WARNING, warnMessage);
for (Player p : ess.getServer().getOnlinePlayers())
{
- final User alertUser = ess.getUser(p);
+ final IUser alertUser = ess.getUser(p);
if (alertUser.isAuthorized("essentials.protect.alerts"))
{
alertUser.sendMessage(warnMessage);
@@ -63,10 +63,10 @@ public class EssentialsConnect
}
- private class ProtectReloader implements IConf
+ private class ProtectReloader implements IReload
{
@Override
- public void reloadConfig()
+ public void onReload()
{
if (protect.getStorage() != null)
{
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
index 03ad19cb4..f30de1d81 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.protect;
import static com.earth2me.essentials.I18n._;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
+import com.earth2me.essentials.api.IEssentials;
+import com.earth2me.essentials.api.IUser;
import com.earth2me.essentials.protect.data.IProtectedBlock;
import java.util.ArrayList;
import java.util.List;
@@ -31,7 +31,7 @@ public class EssentialsProtectBlockListener extends BlockListener
return;
}
- final User user = ess.getUser(event.getPlayer());
+ final IUser user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
{
@@ -228,7 +228,7 @@ public class EssentialsProtectBlockListener extends BlockListener
{
return;
}
- final User user = ess.getUser(event.getPlayer());
+ final IUser user = ess.getUser(event.getPlayer());
if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild())
{
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
index 89167b2b9..41b4a69a5 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.protect;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
+import com.earth2me.essentials.api.IEssentials;
+import com.earth2me.essentials.api.IUser;
import com.earth2me.essentials.craftbukkit.FakeExplosion;
import java.util.Locale;
import org.bukkit.Material;
@@ -39,7 +39,7 @@ public class EssentialsProtectEntityListener extends EntityListener
return;
}
- final User user = ess.getUser(target);
+ final IUser user = target instanceof Player ? ess.getUser((Player)target) : null;
if (event instanceof EntityDamageByBlockEvent)
{
final DamageCause cause = event.getCause();
@@ -77,7 +77,7 @@ public class EssentialsProtectEntityListener extends EntityListener
{
final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event;
final Entity eAttack = edEvent.getDamager();
- final User attacker = ess.getUser(eAttack);
+ final IUser attacker = eAttack instanceof Player ? ess.getUser((Player)eAttack) : null;
// PVP Settings
if (target instanceof Player && eAttack instanceof Player
@@ -134,7 +134,7 @@ public class EssentialsProtectEntityListener extends EntityListener
|| (((Projectile)edEvent.getDamager()).getShooter() instanceof Player
&& prot.getSettingBool(ProtectConfig.disable_pvp)
&& (!user.isAuthorized("essentials.protect.pvp")
- || !ess.getUser(((Projectile)edEvent.getDamager()).getShooter()).isAuthorized("essentials.protect.pvp")))))
+ || !ess.getUser((Player)((Projectile)edEvent.getDamager()).getShooter()).isAuthorized("essentials.protect.pvp")))))
{
event.setCancelled(true);
return;
@@ -299,7 +299,7 @@ public class EssentialsProtectEntityListener extends EntityListener
{
return;
}
- final User user = ess.getUser(event.getTarget());
+ final IUser user = ess.getUser((Player)event.getTarget());
if ((event.getReason() == TargetReason.CLOSEST_PLAYER
|| event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY
|| event.getReason() == TargetReason.PIG_ZOMBIE_TARGET
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
index ad7831a53..a3f13a428 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.protect;
import static com.earth2me.essentials.I18n._;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
+import com.earth2me.essentials.api.IEssentials;
+import com.earth2me.essentials.api.IUser;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.block.Action;
@@ -26,7 +26,7 @@ public class EssentialsProtectPlayerListener extends PlayerListener
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());
+ final IUser user = ess.getUser(event.getPlayer());
if (event.hasItem()
&& (event.getItem().getType() == Material.WATER_BUCKET