[trunk] weather / thunder refactor, added /lightning. usage: /lightning [player] it will zap them and kill them. You can also zap yourself.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1278 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
ementalo 2011-04-26 12:39:57 +00:00
parent 6a892fcfc1
commit aaee159fc9
4 changed files with 49 additions and 13 deletions

View file

@ -0,0 +1,45 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import java.util.List;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.entity.Player;
public class Commandlightning extends EssentialsCommand
{
public Commandlightning()
{
super("lightning");
}
@Override
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
{
if (args.length < 1)
{
user.sendMessage("§cUsage: /" + commandLabel + " [player]");
return;
}
World world = user.getWorld();
if(server.matchPlayer(args[0]).isEmpty())
{
user.sendMessage("§cPlayer not found");
return;
}
for (Player p : server.matchPlayer(args[0]))
{
user.sendMessage("§7Smiting" + p.getDisplayName());
world.strikeLightning(p.getLocation());
p.setHealth(0);
p.sendMessage("§7You have just been smited");
}
user.charge(this);
}
}

View file

@ -24,12 +24,6 @@ public class Commandthunder extends EssentialsCommand
return;
}
if (!user.isAuthorized(this))
{
user.sendMessage("§cThe power of the Thor has been denied to you");
return;
}
user.charge(this);
World world = user.getWorld();
boolean setThunder = args[0].equalsIgnoreCase("true");

View file

@ -23,13 +23,7 @@ public class Commandweather extends EssentialsCommand
return;
}
if (!user.isAuthorized(this))
{
user.sendMessage("§cThe power of the sky has been denied to you");
return;
}
boolean isStorm = args[0].equalsIgnoreCase("storm");
boolean isStorm = args[0].equalsIgnoreCase("storm");
World world = user.getWorld();
user.charge(this);
if (!args[1].isEmpty() || args[1] != null)

View file

@ -144,6 +144,9 @@ commands:
description: List all online players.
usage: /<command>
aliases: [playerlist,who,online,elist]
lightning:
description: Smite down players with the power of Thor
usage: /<command> [player]
mail:
description: Manages inter-player, intra-server mail.
usage: /<command> [read|clear|send [to] [message]]