summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-03-16 08:55:39 +0000
committerKHobbits <rob@khobbits.co.uk>2013-03-16 08:55:39 +0000
commit6185581962efe6a8eacc4ff73cf18b452f880b7c (patch)
treec4388e03d93d0f1b25b0902ea0deeb75cbe3796f /EssentialsProtect/src
parent24a9a74fd5f65025087f68a505dd2735bb0a728f (diff)
downloadEssentials-6185581962efe6a8eacc4ff73cf18b452f880b7c.tar
Essentials-6185581962efe6a8eacc4ff73cf18b452f880b7c.tar.gz
Essentials-6185581962efe6a8eacc4ff73cf18b452f880b7c.tar.lz
Essentials-6185581962efe6a8eacc4ff73cf18b452f880b7c.tar.xz
Essentials-6185581962efe6a8eacc4ff73cf18b452f880b7c.zip
Fix Minecart class rename
Lets use consistent versions in the code base Bukkit: 1700 CB: 2648
Diffstat (limited to 'EssentialsProtect/src')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
index b2b2baa1d..faa2dd5c7 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
@@ -4,6 +4,7 @@ import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import java.util.Locale;
import org.bukkit.entity.*;
+import org.bukkit.entity.minecart.ExplosiveMinecart;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@@ -102,14 +103,14 @@ public class EssentialsProtectEntityListener implements Listener
event.setCancelled(true);
return;
}
-
- if (eAttack instanceof MinecartTNT && prot.getSettingBool(ProtectConfig.prevent_tntminecart_playerdmg)
+
+ if (eAttack instanceof ExplosiveMinecart && prot.getSettingBool(ProtectConfig.prevent_tntminecart_playerdmg)
&& !(target instanceof Player && shouldBeDamaged(user, "tnt-minecart")))
{
event.setCancelled(true);
return;
}
-
+
// PVP Settings
if (target instanceof Player && eAttack instanceof Player
&& prot.getSettingBool(ProtectConfig.disable_pvp)
@@ -223,25 +224,25 @@ public class EssentialsProtectEntityListener implements Listener
&& prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
{
event.setCancelled(true);
-
+
}
else if ((entity instanceof Fireball || entity instanceof SmallFireball)
&& prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
{
event.setCancelled(true);
-
+
}
else if ((entity instanceof WitherSkull)
&& prot.getSettingBool(ProtectConfig.prevent_witherskull_explosion))
{
event.setCancelled(true);
}
- else if ((entity instanceof MinecartTNT)
+ else if ((entity instanceof ExplosiveMinecart)
&& prot.getSettingBool(ProtectConfig.prevent_tntminecart_explosion))
{
event.setCancelled(true);
}
-
+
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
@@ -317,10 +318,10 @@ public class EssentialsProtectEntityListener implements Listener
public void onPaintingBreak(HangingBreakByEntityEvent event)
{
if ((event.getCause() == HangingBreakEvent.RemoveCause.ENTITY)
- && ((event.getRemover() instanceof Creeper) && prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
- || (((event.getRemover() instanceof Fireball) || (event.getRemover() instanceof SmallFireball)) && prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
- || ((event.getRemover() instanceof TNTPrimed) && prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
- || ((event.getRemover() instanceof WitherSkull) && prot.getSettingBool(ProtectConfig.prevent_witherskull_explosion))))
+ && ((event.getRemover() instanceof Creeper) && prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
+ || (((event.getRemover() instanceof Fireball) || (event.getRemover() instanceof SmallFireball)) && prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
+ || ((event.getRemover() instanceof TNTPrimed) && prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
+ || ((event.getRemover() instanceof WitherSkull) && prot.getSettingBool(ProtectConfig.prevent_witherskull_explosion))))
{
event.setCancelled(true);
}