removed command csf

This commit is contained in:
Tobias Ottenweller 2012-05-16 22:44:52 +02:00
parent 5f12bb5d99
commit cd42698928
3 changed files with 0 additions and 88 deletions

View File

@ -72,7 +72,6 @@ public class Plugin extends JavaPlugin
// Add the commands
commands.add(new CommandHelp());
commands.add(new CommandCreate());
commands.add(new CommandCreateSetFrom());
commands.add(new CommandDelete());
commands.add(new CommandSetFrom());
commands.add(new CommandSetTo());

View File

@ -1,86 +0,0 @@
package org.mcteam.ancientgates.commands;
import java.util.Set;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.command.CommandSender;
import org.mcteam.ancientgates.Gate;
import org.mcteam.ancientgates.util.FloodUtil;
public class CommandCreateSetFrom extends BaseCommand
{
public CommandCreateSetFrom()
{
aliases.add("createsetfrom");
aliases.add("newsetfrom");
aliases.add("csf");
aliases.add("nsf");
requiredParameters.add("id");
hasGateParam = false;
helpDescription = "Create a gate and set \"from\" to your location.";
}
public void perform()
{
String id = parameters.get(0);
if (Gate.exists(id)) {
sendMessage("There gate \"" + id + "\" already exists.");
return;
}
Gate.create(id);
sendMessage("Gate with id \"" + id + "\" was created.");
gate = Gate.get(id);
// The player might stand in a halfblock or a sign or whatever
// Therefore we load som extra locations and blocks
Block playerBlock = player.getLocation().getBlock();
Block upBlock = playerBlock.getRelative(BlockFace.UP);
Location playerUpLocation = new Location(player.getLocation().getWorld(),
player.getLocation().getX(),
player.getLocation().getY() + 1,
player.getLocation().getZ(),
player.getLocation().getYaw(),
player.getLocation().getPitch());
Set<Block> gateBlocks = FloodUtil.getGateFrameBlocks(player.getLocation().getBlock());
if (gateBlocks == null)
{
sendMessage("Could not set from! Your portal is too large.\nMax size is: " /*+ Conf.getGateMaxArea()*/ + " Blocks.");
return;
}
if (playerBlock.getType() == Material.AIR)
{
gate.setLocation(player.getLocation());
}
else if (upBlock.getType() == Material.AIR)
{
gate.setLocation(playerUpLocation);
}
else
{
sendMessage("Could not set from! There is not enough room for a gate to open here");
return;
}
sendMessage("From location for gate \""+gate.getId()+"\" is now where you stand.");
sendMessage("Your gate includes " + gateBlocks.size() + " Blocks.");
}
@Override
public boolean hasPermission(CommandSender sender)
{
return sender.hasPermission(permissionManage);
}
}

View File

@ -71,7 +71,6 @@ public class CommandHelp extends BaseCommand
pageLines.add( new CommandHelp().getUsageTemplate(true, true) );
pageLines.add( new CommandCreate().getUsageTemplate(true, true) );
pageLines.add( new CommandCreateSetFrom().getUsageTemplate(true, true) );
pageLines.add( new CommandDelete().getUsageTemplate(true, true) );
pageLines.add( new CommandSetFrom().getUsageTemplate(true, true) );
pageLines.add( new CommandSetTo().getUsageTemplate(true, true) );