introduction of CommandInfo
This commit is contained in:
parent
7af7e42d38
commit
3e44450a7a
@ -21,6 +21,7 @@ import org.mcteam.ancientgates.commands.CommandCreate;
|
||||
import org.mcteam.ancientgates.commands.CommandCreateSetFrom;
|
||||
import org.mcteam.ancientgates.commands.CommandDelete;
|
||||
import org.mcteam.ancientgates.commands.CommandHelp;
|
||||
import org.mcteam.ancientgates.commands.CommandInfo;
|
||||
import org.mcteam.ancientgates.commands.CommandList;
|
||||
import org.mcteam.ancientgates.commands.CommandOpen;
|
||||
import org.mcteam.ancientgates.commands.CommandRename;
|
||||
@ -74,6 +75,7 @@ public class Plugin extends JavaPlugin {
|
||||
commands.add(new CommandRename());
|
||||
commands.add(new CommandClose());
|
||||
commands.add(new CommandList());
|
||||
commands.add(new CommandInfo());
|
||||
|
||||
// Ensure basefolder exists!
|
||||
this.getDataFolder().mkdirs();
|
||||
|
@ -75,6 +75,7 @@ public class CommandHelp extends BaseCommand {
|
||||
pageLines.add( new CommandRename().getUseageTemplate(true, true) );
|
||||
pageLines.add( new CommandClose().getUseageTemplate(true, true) );
|
||||
pageLines.add( new CommandList().getUseageTemplate(true, true) );
|
||||
pageLines.add( new CommandInfo().getUseageTemplate(true, true) );
|
||||
helpPages.add(pageLines);
|
||||
}
|
||||
|
||||
|
34
src/org/mcteam/ancientgates/commands/CommandInfo.java
Normal file
34
src/org/mcteam/ancientgates/commands/CommandInfo.java
Normal file
@ -0,0 +1,34 @@
|
||||
package org.mcteam.ancientgates.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
|
||||
public class CommandInfo extends BaseCommand
|
||||
{
|
||||
public CommandInfo()
|
||||
{
|
||||
aliases.add("info");
|
||||
aliases.add("details");
|
||||
|
||||
requiredParameters.add("id");
|
||||
|
||||
helpDescription = "Prints information about a gate";
|
||||
}
|
||||
|
||||
|
||||
public void perform()
|
||||
{
|
||||
sendMessage(ChatColor.LIGHT_PURPLE + "Information about " + ChatColor.WHITE + gate.getId() + ChatColor.LIGHT_PURPLE + ":");
|
||||
|
||||
if (gate.getFrom() != null)
|
||||
sendMessage(ChatColor.GREEN + "'from' location: " + ChatColor.YELLOW + "( " + gate.getFrom().getBlockX() + " | " + gate.getFrom().getBlockY() + " | " + gate.getFrom().getBlockZ() + " )");
|
||||
else
|
||||
sendMessage(ChatColor.GREEN + "this gate has no 'from' location");
|
||||
|
||||
if (gate.getTo() != null)
|
||||
sendMessage(ChatColor.GREEN + "'to' location: " + ChatColor.YELLOW + "( " + gate.getTo().getBlockX() + " | " + gate.getTo().getBlockY() + " | " + gate.getTo().getBlockZ() + " )");
|
||||
else
|
||||
sendMessage(ChatColor.GREEN + "this gate has no 'to' location");
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user