mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-26 22:06:07 +00:00
@@ -0,0 +1,37 @@
|
||||
package com.bekvon.bukkit.residence.commandsub;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandException;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bekvon.bukkit.residence.Residence;
|
||||
import com.bekvon.bukkit.residence.protection.ResidenceManager;
|
||||
import com.bekvon.bukkit.residence.text.Language;
|
||||
|
||||
import cn.citycraft.PluginHelper.commands.BaseCommand;
|
||||
|
||||
public class CommandCurrent extends BaseCommand {
|
||||
Residence plugin;
|
||||
|
||||
public CommandCurrent(final Residence plugin) {
|
||||
super("current");
|
||||
this.plugin = plugin;
|
||||
setOnlyPlayerExecutable(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
|
||||
final Player player = (Player) sender;
|
||||
final ResidenceManager rmanager = plugin.getResidenceManager();
|
||||
final Language language = plugin.getLanguage();
|
||||
final String res = rmanager.getNameByLoc(player.getLocation());
|
||||
if (res == null) {
|
||||
player.sendMessage(ChatColor.RED + language.getPhrase("NotInResidence"));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.GREEN + language.getPhrase("InResidence", ChatColor.YELLOW + res + ChatColor.GREEN));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user