Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.nunber1_Master.Thor;
- import org.bukkit.ChatColor;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.block.Block;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- public class ThorThorrCommand implements CommandExecutor
- {
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String cmdlabel, String[] args)
- {
- Player player = (Player) sender;
- World world = player.getWorld();
- Location location = player.getLocation();
- ChatColor red = ChatColor.RED;
- ChatColor yellow = ChatColor.YELLOW;
- if(cmdlabel.equalsIgnoreCase("thorr"))
- {
- if(args[0].equalsIgnoreCase("destroy"))
- {
- if(args.length == 1 && player.hasPermission("thor.destroy.me"))
- {
- world.strikeLightningEffect(location);
- world.createExplosion(location, 0);
- player.sendMessage(yellow + "[Thor] " + player.getDisplayName() + red + ", you have been granted the power of " + yellow + "Thor!");
- }
- else if(args[1].equalsIgnoreCase("-d") && player.hasPermission("thor.destroy.me"))
- {
- world.strikeLightning(location);
- world.createExplosion(location, 0);
- player.sendMessage(yellow + "[Thor] " + player.getDisplayName() + red + ", you have painfully recieved the power of " + yellow + "Thor!");
- }
- else if(args.length == 2 && player.hasPermission("thor.destroy.other"))
- {
- if(player.getServer().getPlayer(args[1]) != null)
- {
- Player target = player.getServer().getPlayer(args[1]);
- Location targetlocation = target.getLocation();
- world.strikeLightningEffect(targetlocation);
- world.createExplosion(targetlocation, 0);
- player.sendMessage(yellow + "[Thor] " + target.getDisplayName() + red + " was succesfuly hit!");
- }
- else
- {
- player.sendMessage(yellow + "[Thor] " + args[1] + red + " is not online right now.");
- player.sendMessage(yellow + "[Thor] " +red + "Please leave a message after the 'BEEP!'.");
- world.strikeLightningEffect(location);
- world.createExplosion(location, 0);
- player.sendMessage(yellow + "[Thor] " +red + "BEEP!");
- }
- }
- else if(args.length == 3 && player.hasPermission("thor.destroy.other"))
- {
- if(args[1].equalsIgnoreCase("-d") && player.getServer().getPlayer(args[2]) != null)
- {
- Player target = player.getServer().getPlayer(args[2]);
- Location targetlocation = target.getLocation();
- world.strikeLightning(targetlocation);
- world.createExplosion(targetlocation, 0);
- player.sendMessage(yellow + "[Thor] " + target.getDisplayName() + red + " was succesfuly destroyed!");
- }
- else
- {
- player.sendMessage(yellow + "[Thor] " + args[1] + red + " is not online right now.");
- player.sendMessage(yellow + "[Thor] " +red + "Please leave a message after the 'BEEP!'.");
- world.strikeLightning(location);
- world.createExplosion(location, 0);
- player.sendMessage(yellow + "[Thor] " +red + "BEEP!");
- }
- }
- else
- {
- player.sendMessage(yellow + "[Thor] " + red + "You do not have permission to run that command!");
- }
- }
- if(args[0].equalsIgnoreCase("rage"))
- {
- if(player.hasPermission("thor.rage.me"))
- {
- if(args.length == 1)
- {
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightningEffect(location);
- world.createExplosion(location, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " + red + "Your rage has powered you!");
- }
- else if(args[1].equalsIgnoreCase("-d"))
- {
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightning(location);
- world.createExplosion(location, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " + red + "Your rage has OVER powered you!");
- }
- }
- else if(player.hasPermission("thor.rage.look"))
- {
- if(args.length == 2 && args[1].equalsIgnoreCase("-l"))
- {
- Block pointedblock = player.getTargetBlock(null, 50);
- Location pointedlocation = pointedblock.getLocation();
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightningEffect(pointedlocation);
- world.createExplosion(pointedlocation, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " + red + "Your target was successfully destroyed!");
- }
- else if(args.length == 3 && ((args[1].equalsIgnoreCase("-l") && args[2].equalsIgnoreCase("-d")) || (args[1].equalsIgnoreCase("-d") && args[2].equalsIgnoreCase("-l"))))
- {
- Block pointedblock = player.getTargetBlock(null, 50);
- Location pointedlocation = pointedblock.getLocation();
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightning(pointedlocation);
- world.createExplosion(pointedlocation, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " + red + "Your target was successfully destroyed, painfully!");
- }
- }
- else if(player.hasPermission("thor.rage.other"))
- {
- if(args.length == 2 && player.getServer().getPlayer(args[1]) != null)
- {
- Player target = player.getServer().getPlayer(args[1]);
- Location targetlocation = target.getLocation();
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightningEffect(targetlocation);
- world.createExplosion(targetlocation, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " + red + "The target player was successfully hit!");
- }
- else if(player.getServer().getPlayer(args[1]) == null)
- {
- player.sendMessage(yellow + "[Thor] " + args[1] + red + " is not online right now.");
- player.sendMessage(yellow + "[Thor] " +red + "Please leave a message after the 'BEEP!'.");
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightningEffect(location);
- world.createExplosion(location, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " +red + "BEEP!");
- }
- else if(args[1].equalsIgnoreCase("-d") && player.getServer().getPlayer(args[2]) != null)
- {
- Player target = player.getServer().getPlayer(args[2]);
- Location targetlocation = target.getLocation();
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightning(targetlocation);
- world.createExplosion(targetlocation, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- }
- else if(player.getServer().getPlayer(args[2]) == null)
- {
- player.sendMessage(yellow + "[Thor] " + args[1] + red + " is not online right now.");
- player.sendMessage(yellow + "[Thor] " +red + "Please leave a message after the 'BEEP!'.");
- int counter = 0;
- while(counter < 20)
- {
- world.strikeLightning(location);
- world.createExplosion(location, 0);
- try
- {
- Thread.sleep(150);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- counter++;
- }
- player.sendMessage(yellow + "[Thor] " +red + "BEEP!");
- }
- }
- else
- {
- player.sendMessage(yellow + "[Thor] " + red + "You do not have permission to run that command!");
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement