diff --git a/src/org/mcteam/ancientgates/Plugin.java b/src/org/mcteam/ancientgates/Plugin.java index 5c15295..3cf9751 100644 --- a/src/org/mcteam/ancientgates/Plugin.java +++ b/src/org/mcteam/ancientgates/Plugin.java @@ -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()); diff --git a/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java b/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java deleted file mode 100644 index 3283662..0000000 --- a/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java +++ /dev/null @@ -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 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); - } -} diff --git a/src/org/mcteam/ancientgates/commands/CommandHelp.java b/src/org/mcteam/ancientgates/commands/CommandHelp.java index 9559d7d..8e3d946 100644 --- a/src/org/mcteam/ancientgates/commands/CommandHelp.java +++ b/src/org/mcteam/ancientgates/commands/CommandHelp.java @@ -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) );