unhide to setVisible
This commit is contained in:
parent
1844df81f3
commit
7f2c85e5cc
34
src/org/mcteam/ancientgates/commands/CommandSetVisible.java
Normal file
34
src/org/mcteam/ancientgates/commands/CommandSetVisible.java
Normal 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.");
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user