Handle TNT Minecarts with tnt flag/settings.

This commit is contained in:
wizjany 2013-03-15 15:32:57 -04:00
parent f07acea3e1
commit 89430c13ec
2 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.4.7-R1.0</version>
<version>1.5-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -35,6 +35,8 @@
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Fireball;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.MinecartTNT;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.TNTPrimed;
@ -272,7 +274,7 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
}
}
if (attacker instanceof TNTPrimed) {
if (attacker instanceof TNTPrimed || attacker instanceof MinecartTNT) {
// The check for explosion damage should be handled already... But... What ever...
if (wcfg.blockTNTExplosions) {
@ -598,7 +600,7 @@ public void onEntityExplode(EntityExplodeEvent event) {
}
}
}
} else if (ent instanceof TNTPrimed) {
} else if (ent instanceof TNTPrimed || ent instanceof MinecartTNT) {
if (wcfg.blockTNTBlockDamage) {
event.blockList().clear();
return;