Fixed NPE?

This commit is contained in:
alisolarflare 2016-12-02 22:41:32 -05:00
parent 3d88f355fb
commit 46e05f99f7

View file

@ -60,7 +60,7 @@ public class CannonBowListener implements Listener {
@EventHandler
public void onTnTExplode(EntityExplodeEvent event) {
if (event.getEntityType() != EntityType.PRIMED_TNT) return;
if (!event.getEntity().getCustomName().equals(launchedTNTName)) return;
if (event.getEntity().getCustomName() != "CANNON BOW TNT:42170") return;
Location loc = event.getEntity().getLocation();
event.getEntity().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 3, false, false);