Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Stackoverflow Lynked

By: a guest on Jul 11th, 2012  |  syntax: Java  |  size: 2.93 KB  |  views: 119  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package me.legacyp7.Lynked;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.Location;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.plugin.PluginDescriptionFile;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13. public class Lynked extends JavaPlugin{
  14.         public final Logger logger = Logger.getLogger("Minecraft");
  15.         public static Lynked plugin;
  16.        
  17.         @Override
  18.         public void onDisable () {
  19.                 PluginDescriptionFile pdfFile = this.getDescription();
  20.                 this.logger.info("[" + pdfFile.getName() + "]" + " has been Disabled!");
  21.         }
  22.        
  23.         @Override
  24.         public void onEnable () {
  25.                 PluginDescriptionFile pdfFile = this.getDescription();
  26.                 this.logger.info("[" + pdfFile.getName() + "]" + " Version " + pdfFile.getVersion() + " has been Enabled!");
  27.                 this.logger.info("[" + pdfFile.getName() + "]" + " coded and managed by LegacyP7.");
  28.         }
  29.        
  30.         public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
  31.                 Player player = (Player) sender;
  32.                 String com = cmd.getName();
  33.                 if(com.equalsIgnoreCase("heal")); {
  34.                         if(args.length == 0){
  35.                                 player.setHealth(20);
  36.                                 player.sendMessage(ChatColor.GREEN + "You have been Healed!");
  37.                         }else if(args.length == 1){
  38.                                 if(player.getServer().getPlayer(args[0])!= null){
  39.                                 Player targetPlayer = player.getServer().getPlayer(args [0]);
  40.                                 targetPlayer.setHealth(20);
  41.                                 player.sendMessage(ChatColor.GREEN + "You have been Healed!");
  42.                         }else{
  43.                                 player.sendMessage(ChatColor.RED + "That player is not online!");
  44.                         }
  45.                 }
  46.                         return true;           
  47.                 }
  48.        
  49.                
  50.                 if(com.equalsIgnoreCase("ext")); { ///////////I am getting the error on this line
  51.                         if(args.length == 0){
  52.                                 player.setFireTicks(0);
  53.                                 player.sendMessage(ChatColor.BLUE + "You have been Extinguished!");
  54.                         }else if(args.length == 1){
  55.                                 if(player.getServer().getPlayer(args[0])!= null){
  56.                                 Player targetPlayer = player.getServer().getPlayer(args [0]);
  57.                                 targetPlayer.setFireTicks(0);
  58.                                 player.sendMessage(ChatColor.BLUE + "You have been Extinguished!");
  59.                         }else{
  60.                                 player.sendMessage(ChatColor.RED + "That player is not online!");
  61.                         }
  62.                 }      
  63.                         return true;   
  64.                 }
  65.                
  66.                 if(com.equalsIgnoreCase("tele")); {
  67.                         if(args.length == 0){
  68.                                 player.sendMessage(ChatColor.DARK_RED + "Not enough arguments. Please use: " + ChatColor.BLUE + "/tele <username>");
  69.                         }else if (args.length == 1){
  70.                                 Player targetPlayer = player.getServer().getPlayer(args[0]);
  71.                                 Location targetPlayerLocation = targetPlayer.getLocation();
  72.                                 player.teleport(targetPlayerLocation);
  73.                         }else if(args.length == 2){
  74.                                 Player targetPlayer = player.getServer().getPlayer(args[0]);
  75.                                 Player targetPlayer1 = player.getServer().getPlayer(args[1]);
  76.                                 Location targetPlayer1Location = targetPlayer1.getLocation();
  77.                                 targetPlayer.teleport(targetPlayer1Location);
  78.                         }      
  79.                 return true;
  80.                 }
  81.                
  82.        
  83.                 return false;
  84.         }
  85.        
  86. }