public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
if(cmd.getName().equalsIgnoreCase("test")){
Location loc1 = new Location(player.getWorld(), 131, 57, 253);
Location loc2 = new Location(player.getWorld(), 137, 67, 247);
int minx = Math.min(loc1.getBlockX(), loc2.getBlockX()),
miny = Math.min(loc1.getBlockY(), loc2.getBlockY()),
minz = Math.min(loc1.getBlockZ(), loc2.getBlockZ()),
maxx = Math.max(loc1.getBlockX(), loc2.getBlockX()),
maxy = Math.max(loc1.getBlockY(), loc2.getBlockY()),
maxz = Math.max(loc1.getBlockZ(), loc2.getBlockZ());
for(int x = minx; x<=maxx;x++){
for(int y = miny; y<=maxy;y++){
for(int z = minz; z<=maxz;z++)
{
Player p = (Player) sender;
p.getWorld().getBlockAt(x, y, z).setTypeId(0);
}
}
}
return true;
}
Player player = (Player) sender;
if(cmd.getName().equalsIgnoreCase("CustomCrafting")){
player.sendMessage(ChatColor.GRAY + "Goto" + ChatColor.GREEN + " http://www.tempeststyle.net/archives/399 " + ChatColor.GRAY + "For Crafting Recipes (Click on the Link!)");
return false;
}
if(cmd.getName().equalsIgnoreCase("premove")){
player.removePotionEffect(PotionEffectType.WEAKNESS);
player.removePotionEffect(PotionEffectType.POISON);
player.sendMessage("Negative Potion Effects Removed!");
return false;
}
if(player.hasPermission("CustomCrafting.potion.effects")) {
if(cmd.getName().equalsIgnoreCase("potion")){
if(args.length == 0){
player.sendMessage("Correct Usage: /potion [potion-effect] [intensity] [length] [playername] or /potion remove [playername]");
return false;
}
if(args[0].equalsIgnoreCase("list")){
player.sendMessage("All Potion Effects: Speed, Blindness, Confusion, Damage_Resistance, Fast_Digging, Fire_Resistance, Harm, Heal, Hunger, Increase_Damage, Jump, Poison, Regeneration, Slow, Slow_Digging, Water_Breathing, Weakness");
return false;
}
if(args[0].equalsIgnoreCase("remove")){
if(args.length == 1){
for (PotionEffect effect : player.getActivePotionEffects())
player.removePotionEffect(effect.getType());
player.sendMessage(ChatColor.GREEN + "All Potion Effects Removed!");
return false;
}
}
if(args.length == 2){
if(getServer().getPlayer(args[1]) != null){
Player p2 = getServer().getPlayer(args[1]);
for (PotionEffect effect : player.getActivePotionEffects())
p2.removePotionEffect(effect.getType());
p2.sendMessage(ChatColor.GREEN + "All Potion Effects Removed!");
return false;
}
}
}
}
if(player.hasPermission("CustomCrafting.potion.add")) {
PotionEffectType pe = PotionEffectType.getByName(args[0].toUpperCase());
if(args.length == 4){
int te = Integer.parseInt(args[1]);
int time = Integer.parseInt(args[2])*20;
if(getServer().getPlayer(args[3]) != null){
Player p = getServer().getPlayer(args[3]);
p.removePotionEffect(pe);
p.addPotionEffect(new PotionEffect(pe, time, te));
p.sendMessage(ChatColor.GOLD + "Set to " + ChatColor.GREEN + pe.getName() + ChatColor.GOLD + " at Intensity " + ChatColor.GREEN + te + ChatColor.GOLD + " for player " + ChatColor.GREEN + p.getDisplayName() + ChatColor.GOLD + "!");
}else{
player.sendMessage("Player is not Online!");
}
if(args.length < 4){
player.sendMessage("Incorrect Usage! Correct Usage: /potion [potion-effect] [intensity] [length] [playername]");
return false;
}
if(args.length > 4){
player.sendMessage("Incorrect Usage! Correct Usage: /potion [potion-effect] [intensity] [length] [playername]");
return false;
}
}
}
return false;
}
}