Fixes an NPE involving certain explosions.

This commit is contained in:
Glitchfinder 2012-11-04 16:39:06 -08:00
parent c7b3b7a826
commit f4cb83319e

View File

@ -229,10 +229,12 @@ public class EntityListener implements Listener {
@EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEnitityExplode(EntityExplodeEvent event) { public void onEnitityExplode(EntityExplodeEvent event) {
Entity entity = event.getEntity(); Entity entity = event.getEntity();
if(entity == null) return;
if(entity.hasMetadata("NPC")) return; // Check if this player is a Citizens NPC if(entity.hasMetadata("NPC")) return; // Check if this player is a Citizens NPC
if (event.getEntity() instanceof TNTPrimed) { if (entity instanceof TNTPrimed) {
int id = entity.getEntityId(); int id = entity.getEntityId();
if (plugin.tntIsTracked(id)) { if (plugin.tntIsTracked(id)) {