@EventHandler
	public void onInteract(PlayerInteractEvent e) {

		Player player = e.getPlayer();
		if (player.hasPermission("explosionman.boomstick")) {
			if (MainClass.players.getString("players." + player.getName()
					+ ".settings.boomstickid") == null) {
				@SuppressWarnings("deprecation")
				int blockId = player.getItemInHand().getTypeId();
				if (blockId == MainClass.getConfig().getInt("boomitem")) {
					Action a = e.getAction();
					if (a.equals(Action.RIGHT_CLICK_AIR)) {
						@SuppressWarnings("deprecation")
						Block block = player.getTargetBlock(null, 200);
						Location blocation = block.getLocation();
						double pX = blocation.getX();
						double pY = blocation.getY();
						double pZ = blocation.getZ();
						if (MainClass.getConfig().getBoolean("boomstickmsg")) {
							String explodemsg = MainClass.getConfig()
									.getString("boomsticktext")
									.replaceAll("(&([a-f0-9]))", "\u00A7$2");
							player.sendMessage(explodemsg);
						}
						player.getWorld().createExplosion(pX, pY, pZ,
								MainClass.getConfig().getInt("boompower"),
								MainClass.getConfig().getBoolean("boomfire"),
								MainClass.getConfig().getBoolean("boomblocks"));
						if (player.hasPermission("explosionman.boomlightning")) {
							player.getWorld().strikeLightningEffect(blocation);
						}
				} else if (a.equals(Action.RIGHT_CLICK_BLOCK)) {
					@SuppressWarnings("deprecation")
					Block block = player.getTargetBlock(null, 200);
					Location blocation = block.getLocation();
					double pX = blocation.getX();
					double pY = blocation.getY();
					double pZ = blocation.getZ();
					if (MainClass.getConfig().getBoolean("boomstickmsg")) {
						String explodemsg = MainClass.getConfig()
								.getString("boomsticktext")
								.replaceAll("(&([a-f0-9]))", "\u00A7$2");
						player.sendMessage(explodemsg);
					}
					player.getWorld().createExplosion(pX, pY, pZ,
							MainClass.getConfig().getInt("boompower"),
							MainClass.getConfig().getBoolean("boomfire"),
							MainClass.getConfig().getBoolean("boomblocks"));
					if (player.hasPermission("explosionman.boomlightning")) {
						player.getWorld().strikeLightningEffect(blocation);
					}
				}
				}
		}
			else if(MainClass.players.getString("players." + player.getName()
					+ ".settings.boomstickid") != null){
				@SuppressWarnings("deprecation")
				int blockId = player.getItemInHand().getTypeId();
				int tool = Integer.parseInt(MainClass.players.getString("players." + player.getName()
						+ ".settings.boomstickid"));
				
				if (blockId == tool) {
					Action a = e.getAction();
					if (a.equals(Action.RIGHT_CLICK_AIR)) {
						@SuppressWarnings("deprecation")
						Block block = player.getTargetBlock(null, 200);
						Location blocation = block.getLocation();
						double pX = blocation.getX();
						double pY = blocation.getY();
						double pZ = blocation.getZ();
						if (MainClass.getConfig().getBoolean("boomstickmsg")) {
							String explodemsg = MainClass.getConfig()
									.getString("boomsticktext")
									.replaceAll("(&([a-f0-9]))", "\u00A7$2");
							player.sendMessage(explodemsg);
						}
						player.getWorld().createExplosion(pX, pY, pZ,
								MainClass.getConfig().getInt("boompower"),
								MainClass.getConfig().getBoolean("boomfire"),
								MainClass.getConfig().getBoolean("boomblocks"));
						if (player.hasPermission("explosionman.boomlightning")) {
							player.getWorld().strikeLightningEffect(blocation);
						}
				} else if (a.equals(Action.RIGHT_CLICK_BLOCK)) {
					@SuppressWarnings("deprecation")
					Block block = player.getTargetBlock(null, 200);
					Location blocation = block.getLocation();
					double pX = blocation.getX();
					double pY = blocation.getY();
					double pZ = blocation.getZ();
					if (MainClass.getConfig().getBoolean("boomstickmsg")) {
						String explodemsg = MainClass.getConfig()
								.getString("boomsticktext")
								.replaceAll("(&([a-f0-9]))", "\u00A7$2");
						player.sendMessage(explodemsg);
					}
					player.getWorld().createExplosion(pX, pY, pZ,
							MainClass.getConfig().getInt("boompower"),
							MainClass.getConfig().getBoolean("boomfire"),
							MainClass.getConfig().getBoolean("boomblocks"));
					if (player.hasPermission("explosionman.boomlightning")) {
						player.getWorld().strikeLightningEffect(blocation);
					}
				}
			}
	}
		
	}
		}