unhide to setVisible

This commit is contained in:
Tobias Ottenweller 2012-05-17 16:44:09 +02:00
parent 1844df81f3
commit 7f2c85e5cc
2 changed files with 34 additions and 35 deletions

View File

@ -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.");
}
}

View File

@ -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);
}
}