diff options
author | ceulemansl <ceulemansl@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-23 00:43:27 +0000 |
---|---|---|
committer | ceulemansl <ceulemansl@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-23 00:43:27 +0000 |
commit | e4fcdaf4a9730073ee029bde3600a6ad3e037762 (patch) | |
tree | 900201f0317bf1a9711a0b395aa9c2770d84f669 | |
parent | 3a0b69e7b05575811827c3cc96d49948ed18a9ed (diff) | |
download | Essentials-e4fcdaf4a9730073ee029bde3600a6ad3e037762.tar Essentials-e4fcdaf4a9730073ee029bde3600a6ad3e037762.tar.gz Essentials-e4fcdaf4a9730073ee029bde3600a6ad3e037762.tar.lz Essentials-e4fcdaf4a9730073ee029bde3600a6ad3e037762.tar.xz Essentials-e4fcdaf4a9730073ee029bde3600a6ad3e037762.zip |
added thunder,
usage: /thunder <true/false> [duration]
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1266 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandthunder.java | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java new file mode 100644 index 000000000..48177e949 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java @@ -0,0 +1,70 @@ +package com.earth2me.essentials.commands; + +import com.earth2me.essentials.Essentials; +import com.earth2me.essentials.User; + +import org.bukkit.Server; + +public class Commandthunder extends EssentialsCommand +{ + public Commandthunder() + { + super("thunder"); + } + + @Override + public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception + { + switch (args.length) + { + case 0: + if (user.isAuthorized("essentials.thunder")) + { + user.sendMessage("§cUsage: /" + commandLabel + " <true/false> [duration]"); + break; + } + user.sendMessage("§cYou are not allowed to change the thunder"); + break; + case 1: + if (user.isAuthorized("essentials.thunder")) + { + if(args[0].equalsIgnoreCase("true")) + { + user.getWorld().setThundering(true); + user.sendMessage("§7You enabled thunder in your world"); + break; + } + if(args[0].equalsIgnoreCase("false")) + { + user.getWorld().setThundering(false); + user.sendMessage("§7You disabled thunder in your world"); + break; + } + user.sendMessage("§cUsage: /" + commandLabel + " <true/false> [duration]"); + } + user.sendMessage("§cYou are not allowed to change the thunder"); + break; + case 2: + if (user.isAuthorized("essentials.thunder")) + { + if(args[0].equalsIgnoreCase("true")) + { + user.getWorld().setThundering(true); + user.getWorld().setWeatherDuration(Integer.parseInt(args[1]) * 20); + user.sendMessage("§7You enabled thunder in your world for " + args[1] + " seconds"); + break; + } + if(args[0].equalsIgnoreCase("false")) + { + user.getWorld().setThundering(false); + user.getWorld().setWeatherDuration(Integer.parseInt(args[1]) * 20); + user.sendMessage("§7You disabled thunder in your world for " + args[1] + " seconds"); + break; + } + user.sendMessage("§cUsage: /" + commandLabel + " <true/false> [duration]"); + } + user.sendMessage("§cYou are not allowed to change the thunder"); + break; + } + } +} |