Skip to content

Instantly share code, notes, and snippets.

@vanZeben
Created August 3, 2013 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanZeben/6145509 to your computer and use it in GitHub Desktop.
Save vanZeben/6145509 to your computer and use it in GitHub Desktop.
package com.zephyrmc.towns.cmds;
import org.bukkit.entity.Player;
import com.zephyrmc.api.cmds.ZephyrCommandHandler;
import com.zephyrmc.api.cmds.ZephyrCommandReceiver;
import com.zephyrmc.api.managers.MessageManager.LogSeverity;
import com.zephyrmc.api.obj.ZephyrPlugin;
import com.zephyrmc.towns.Main;
public class TownAdminCommandHandler extends ZephyrCommandHandler {
public TownAdminCommandHandler(ZephyrPlugin plugin) {
super(plugin, "townadmin");
}
@Override
protected void initRegisteredCommands() {
this.registerCommand("reload", new String[0], "", "Reloads town information", null,
new TownReloadCommandReceiver(plugin));
}
public class TownReloadCommandReceiver extends ZephyrCommandReceiver {
public TownReloadCommandReceiver(ZephyrPlugin plugin) {
super(plugin);
}
@Override
public boolean onPlayerRunCommand(Player player, String[] args) {
((Main) plugin).reload();
this.plugin.getMessageManager().sendMessage(player, "Reloaded the town information");
return true;
}
@Override
public boolean onConsoleRunCommand(String[] args) {
((Main) plugin).reload();
this.plugin.getMessageManager().log(LogSeverity.INFO, "Reloaded the town information");
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment