Added a command to display the current version of the plugin

This commit is contained in:
Jonathan Devine
2012-06-21 18:36:45 +01:00
parent 3e7b4b77fd
commit 99bd9447e1
3 changed files with 42 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
name: Citadel
main: com.untamedears.citadel.Citadel
version: 0.1
version: 1.2
description: Reinforce your structures!
author: cxschx
author: cxschx, chrisrico, jonnyd
database: false
commands:
ctmaterials:
@@ -60,4 +60,7 @@ commands:
usage: /ctdisallow (or /ctd) <player name>
ctremovereinforcements:
description: Removes all reinforcements from the Citadel database.
usage: /ctremovereinforcements
usage: /ctremovereinforcements
ctversion:
description: Displays plugin version
usage: /ctversion

View File

@@ -25,6 +25,7 @@ public class Citadel extends JavaPlugin {
public int flashLength;
private boolean verboseLogging;
public double redstoneDistance;
public double pistonRedstoneDistance;
public long autoModeReset;
public void onEnable() {
@@ -77,12 +78,13 @@ public class Citadel extends JavaPlugin {
getCommand("ctlist").setExecutor(new ListMembers(this));
getCommand("ctallow").setExecutor(new ModifyFaction(this));
getCommand("ctdisallow").setExecutor(new ModifyFaction(this));
getCommand("ctversion").setExecutor(new ViewCurrentVersion(this));
getServer().getPluginManager().registerEvents(new BlockListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
getServer().getPluginManager().registerEvents(new EntityListener(this), this);
log.info("Citadel is now enabled. ( •_•)>⌐■-■ ( ⌐■_■)");
log.info("Citadel is now enabled. ( •_•)>âŒ<C3A2>â -â–  ( âŒ<C3A2>â  )");
}
@Override
@@ -98,7 +100,7 @@ public class Citadel extends JavaPlugin {
public void onDisable() {
Citadel.instance = null;
log.info("Citadel is now disabled. (╯ •_•)╯ 彡┻━┻");
log.info("Citadel is now disabled. (╯ •_•)╯ 彡┻â”<C3A2>â”»");
}
public void logVerbose(String messageFormat, Object... args) {

View File

@@ -0,0 +1,32 @@
package com.untamedears.citadel.command;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.untamedears.citadel.Citadel;
import com.untamedears.citadel.PluginConsumer;
import static com.untamedears.citadel.Utility.sendMessage;
/**
*
* @author JonnyD
*
*/
public class ViewCurrentVersion extends PluginConsumer implements CommandExecutor {
public ViewCurrentVersion(Citadel plugin){
super(plugin);
}
public boolean onCommand(CommandSender sender, Command command, String s,
String[] args) {
String version = plugin.getDescription().getVersion();
sendMessage(sender, ChatColor.WHITE, "Current version is: " + version);
return true;
}
}