{
if (args.length >= 1)
{
if (args[0].toLowerCase().equals("me"))
{
sender.worldObj.addWeatherEffect(new EntityLightningBolt(sender.worldObj, sender.posX, sender.posY, sender.posZ));
OutputHandler.chatConfirmation(sender, "Was that really a good idea?");
}
else
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
player.worldObj.addWeatherEffect(new EntityLightningBolt(player.worldObj, player.posX, player.posY, player.posZ));
OutputHandler.chatConfirmation(sender, "You should feel bad about doing that.");
}
else
{
OutputHandler.chatError(sender, String.format("Player %s does not exist, or is not online.", args[0]));
}
}
}
else
{
MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(sender, 500);
if (mop == null)
{
OutputHandler.chatError(sender, "You must first look at the ground!");
}
else
{
sender.worldObj.addWeatherEffect(new EntityLightningBolt(sender.worldObj, mop.blockX, mop.blockY, mop.blockZ));
OutputHandler.chatConfirmation(sender, "I hope that didn't start a fire.");
}
}
}