mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-28 01:10:52 +00:00
[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:
parent
6a892fcfc1
commit
aaee159fc9
4 changed files with 49 additions and 13 deletions
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,12 +24,6 @@ public class Commandthunder extends EssentialsCommand
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user.isAuthorized(this))
|
|
||||||
{
|
|
||||||
user.sendMessage("§cThe power of the Thor has been denied to you");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
user.charge(this);
|
user.charge(this);
|
||||||
World world = user.getWorld();
|
World world = user.getWorld();
|
||||||
boolean setThunder = args[0].equalsIgnoreCase("true");
|
boolean setThunder = args[0].equalsIgnoreCase("true");
|
||||||
|
|
|
@ -23,13 +23,7 @@ public class Commandweather extends EssentialsCommand
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user.isAuthorized(this))
|
boolean isStorm = args[0].equalsIgnoreCase("storm");
|
||||||
{
|
|
||||||
user.sendMessage("§cThe power of the sky has been denied to you");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isStorm = args[0].equalsIgnoreCase("storm");
|
|
||||||
World world = user.getWorld();
|
World world = user.getWorld();
|
||||||
user.charge(this);
|
user.charge(this);
|
||||||
if (!args[1].isEmpty() || args[1] != null)
|
if (!args[1].isEmpty() || args[1] != null)
|
||||||
|
|
|
@ -144,6 +144,9 @@ commands:
|
||||||
description: List all online players.
|
description: List all online players.
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
aliases: [playerlist,who,online,elist]
|
aliases: [playerlist,who,online,elist]
|
||||||
|
lightning:
|
||||||
|
description: Smite down players with the power of Thor
|
||||||
|
usage: /<command> [player]
|
||||||
mail:
|
mail:
|
||||||
description: Manages inter-player, intra-server mail.
|
description: Manages inter-player, intra-server mail.
|
||||||
usage: /<command> [read|clear|send [to] [message]]
|
usage: /<command> [read|clear|send [to] [message]]
|
||||||
|
|
Loading…
Reference in a new issue