From 7f2c85e5cc60b71431193559602d1708f464a9f0 Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Thu, 17 May 2012 16:44:09 +0200 Subject: [PATCH] unhide to setVisible --- .../commands/CommandSetVisible.java | 34 ++++++++++++++++++ .../ancientgates/commands/CommandUnhide.java | 35 ------------------- 2 files changed, 34 insertions(+), 35 deletions(-) create mode 100644 src/org/mcteam/ancientgates/commands/CommandSetVisible.java delete mode 100644 src/org/mcteam/ancientgates/commands/CommandUnhide.java diff --git a/src/org/mcteam/ancientgates/commands/CommandSetVisible.java b/src/org/mcteam/ancientgates/commands/CommandSetVisible.java new file mode 100644 index 0000000..b6c2bc1 --- /dev/null +++ b/src/org/mcteam/ancientgates/commands/CommandSetVisible.java @@ -0,0 +1,34 @@ +package org.mcteam.ancientgates.commands; + +import org.mcteam.ancientgates.Plugin; + + +public class CommandSetVisible extends BaseCommand +{ + + public CommandSetVisible() + { + aliases.add("makevisible"); + aliases.add("mv"); + + requiredParameters.add("id"); + + helpDescription = "Make that gate visible"; + + requiredPermission = Plugin.permissionManage; + } + + + public void perform() + { + try { + gate.setHidden(false); + } + catch (Exception e) { + sendMessage(e.getMessage()); + } + + sendMessage("The gate " + gate.getId() + " is now visible."); + } + +} \ No newline at end of file diff --git a/src/org/mcteam/ancientgates/commands/CommandUnhide.java b/src/org/mcteam/ancientgates/commands/CommandUnhide.java deleted file mode 100644 index 3fa7178..0000000 --- a/src/org/mcteam/ancientgates/commands/CommandUnhide.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.mcteam.ancientgates.commands; - -import org.bukkit.command.CommandSender; - -public class CommandUnhide extends BaseCommand -{ - - public CommandUnhide() - { - aliases.add("unhide"); - - requiredParameters.add("id"); - - helpDescription = "Unhide that gate"; - } - - public void perform() - { - boolean isOpen = gate.isOpen(); - - gate.setHidden(false); - sendMessage("The gate " + gate.getId() + " is no longer hidden."); - - if (isOpen != gate.isOpen()) { - sendMessage("The Portal is now closed. Does the portal have a frame?"); - } - } - - - @Override - public boolean hasPermission(CommandSender sender) - { - return sender.hasPermission(permissionManage); - } -} \ No newline at end of file