From 112382893dc8981688af4b248eca52762a6859de Mon Sep 17 00:00:00 2001 From: Steven Lawson Date: Mon, 10 Oct 2011 22:26:11 -0400 Subject: [PATCH] Added orbit. --- .../TotalFreedomMod/TFM_Cmds_Admin.java | 37 +++++++++++++++++++ .../TotalFreedomMod/TotalFreedomMod.java | 1 + src/plugin.yml | 5 ++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_Cmds_Admin.java b/src/me/StevenLawson/TotalFreedomMod/TFM_Cmds_Admin.java index c29d44a9..7636ef20 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TFM_Cmds_Admin.java +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_Cmds_Admin.java @@ -15,6 +15,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; //TFM_Cmds_Admin: //fr @@ -651,6 +652,42 @@ public class TFM_Cmds_Admin implements CommandExecutor sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); } + return true; + } + else if (cmd.getName().equalsIgnoreCase("orbit")) + { + if (senderIsConsole || plugin.isUserSuperadmin(sender)) + { + if (args.length == 0) + { + return false; + } + + Player p; + List matches = Bukkit.matchPlayer(args[0]); + if (matches.isEmpty()) + { + sender.sendMessage(ChatColor.GRAY + "Can't find user " + args[0]); + return true; + } + else + { + p = matches.get(0); + } + + double strength = 100.0; + if (args.length >= 2) + { + strength = Double.parseDouble(args[1]); + } + + p.setVelocity(new Vector(0, strength, 0)); + } + else + { + sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); + } + return true; } } diff --git a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java index bc4c8f3e..2be247c3 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java +++ b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java @@ -313,6 +313,7 @@ public class TotalFreedomMod extends JavaPlugin this.getCommand("umd").setExecutor(AdminCommands); this.getCommand("csay").setExecutor(AdminCommands); this.getCommand("cage").setExecutor(AdminCommands); + this.getCommand("orbit").setExecutor(AdminCommands); this.getCommand("explosives").setExecutor(AntiblockCommands); this.getCommand("lavadmg").setExecutor(AntiblockCommands); diff --git a/src/plugin.yml b/src/plugin.yml index 3556bd8a..778ac850 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -9,7 +9,7 @@ commands: usage: / [purge] cage: description: Superadmin command - Place a cage around someone. - usage: / [partialname] + usage: / [off|outermaterial] [water|lava] cake: description: Superadmin command - For the people that are still alive. usage: / @@ -73,6 +73,9 @@ commands: opme: description: Superadmin command - Automatically ops user. usage: / + orbit: + description: Superadmin command - POW!!! Right in the kisser! One of these days Alice, straight to the Moon! + usage: / [power] prelog: description: Superadmin command - Enable/disable the command prelogger. When this is on, logs will be filled with many duplicate messages. usage: /