package simpleexplosivesnowball.teamkarbon.com;

import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.ProjectileHitEvent;

public class SBListener implements Listener {
	
	private Main plugin;
	
	public SBListener(Main plugin) {
		this.plugin = plugin;
	}
	
	@EventHandler
	public void onProjectileHit(ProjectileHitEvent event) {
		
		Entity entity = event.getEntity();

		if (entity instanceof Snowball) {
			Snowball snowball = (Snowball) entity;
			Entity shooter = snowball.getShooter();
			
			if (shooter instanceof Player) {
				Player player = (Player) shooter;
				
				if (plugin.players.contains(player.getName())) {
					player.getWorld().createExplosion(snowball.getLocation(), 3F);
				}
				
			}
			
		}		
	}
}

@@ -42,16 +42,273 @@
 n.com;%0A%0A
+import org.bukkit.entity.Entity;%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.entity.Snowball;%0Aimport org.bukkit.event.EventHandler;%0Aimport org.bukkit.event.Listener;%0Apackage com.teamkarbon.bukkit.SimpleExplosiveSnowBall;%0A%0Aimport org.bukkit.Location;%0A
 import o
@@ -570,17 +570,16 @@
 tener %7B%0A
-%09
 %0A%09privat
@@ -593,17 +593,16 @@
 plugin;%0A
-%09
 %0A%09public
@@ -655,17 +655,16 @@
 gin;%0A%09%7D%0A
-%09
 %0A%09@Event
@@ -728,18 +728,16 @@
 vent) %7B%0A
-%09%09
 %0A%09%09Entit
@@ -767,16 +767,218 @@
 ity();%0A%0A
+%09%09// Config%0A%09%09float size = plugin.getConfig().getInt(%22Size of Explosion%22);%0A%09%09boolean damage = plugin.getConfig().getBoolean(%22Block Damage%22);%0A%09%09boolean fire = plugin.getConfig().getBoolean(%22Set Fire%22);%0A%0A
 %09%09if (en
@@ -1090,19 +1090,16 @@
 oter();%0A
-%09%09%09
 %0A%09%09%09if (
@@ -1165,24 +1165,62 @@
 hooter;%0A%09%09%09%09
+Location sb = snowball.getLocation();%0A
 %0A%09%09%09%09if (plu
@@ -1305,61 +1305,82 @@
 on(s
-nowball.getLocation(), 3F);
+b.getX(), sb.getY(),
 %0A%09%09%09%09
-%7D%0A
 %09%09%09
-%09
+sb.getZ(), size, fire, damage);
 %0A%09%09%09
+%09
 %7D%0A%09%09%09
+%7D
 %0A%09%09%7D
-%09%09
 %0A%09%7D%0A

Update SBListener.java