Created
August 3, 2013 06:53
-
-
Save vanZeben/6145509 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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