Skip to content

Commit

Permalink
Handle TNT Minecarts with tnt flag/settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
wizjany committed Mar 15, 2013
1 parent f07acea commit 89430c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

1 comment on commit 89430c1

@DarkArc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.