Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lele.SimpleBroadCaster.comandos;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.entity.Player;
- import lele.SimpleBroadCaster.SimpleBroadcaster;
- public class MainCommand implements CommandExecutor{
- private SimpleBroadcaster plugin;
- public MainCommand(SimpleBroadcaster plugin){
- this.plugin = plugin;
- }
- FileConfiguration messages = plugin.getMessages();
- String prefix = "messages.prefix";
- public boolean onCommand(CommandSender sender, Command comando, String label, String[] args) {
- if(comando.getName().equalsIgnoreCase("sbc")) {
- if(!( sender instanceof Player)) {
- if(args[0].equalsIgnoreCase("version")) {
- Bukkit.getConsoleSender().sendMessage(messages.getString(prefix)+ChatColor.YELLOW+" Plugin version: "+plugin.version);
- }else if(args[0].equalsIgnoreCase("reload")){
- Bukkit.getConsoleSender().sendMessage(messages.getString(prefix)+ChatColor.YELLOW+" YMLs reloaded");
- //how to reload messages and config
- }
- return true;
- }else {
- Player jugador = (Player) sender;
- jugador.sendMessage("test2");
- return true;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement