summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-26 12:39:57 +0000
committerementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-26 12:39:57 +0000
commitaaee159fc9958d8aab409bd0eb89b2486807b39d (patch)
treebb9fae99ed336e82907e462908e45d31ed9442d1
parent6a892fcfc1fbf6622d193bd013d095404f44caf8 (diff)
downloadEssentials-aaee159fc9958d8aab409bd0eb89b2486807b39d.tar
Essentials-aaee159fc9958d8aab409bd0eb89b2486807b39d.tar.gz
Essentials-aaee159fc9958d8aab409bd0eb89b2486807b39d.tar.lz
Essentials-aaee159fc9958d8aab409bd0eb89b2486807b39d.tar.xz
Essentials-aaee159fc9958d8aab409bd0eb89b2486807b39d.zip
[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
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandlightning.java45
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandthunder.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandweather.java8
-rw-r--r--Essentials/src/plugin.yml3
4 files changed, 49 insertions, 13 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
new file mode 100644
index 000000000..a2379c752
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
@@ -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);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
index ca7a15a0b..a95475ef3 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
@@ -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");
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
index 2d7e9c076..d76807a3f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
@@ -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)
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index bbd843c90..654dba375 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -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]]