本文整理匯總了Java中cn.nukkit.Player.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Player.getName方法的具體用法?Java Player.getName怎麽用?Java Player.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cn.nukkit.Player
的用法示例。
在下文中一共展示了Player.getName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DeathTag
import cn.nukkit.Player; //導入方法依賴的package包/類
public DeathTag(Player player) {
this.tag = new Tag(player.getPosition(), "0분 전에 " + player.getName() + "이(가) 사망", new Long(60 * 10));
this.player = player;
DeathTag.tags.add(this);
Server.getInstance().getScheduler().scheduleRepeatingTask(new AsyncTask() {
@Override
public void onRun() {
for(DeathTag tag : DeathTag.tags) tag.onUpdate();
}
}, 20 * 60, true);
}
示例2: getPlayerSession
import cn.nukkit.Player; //導入方法依賴的package包/類
private PlayerSession getPlayerSession(Player player) {
return new PlayerSession(
0,
player.getName(),
player.getUniqueId().toString(),
playerJoins.get(player.getUniqueId()),
getTime(),
player.getAddress()
);
}
示例3: rekit
import cn.nukkit.Player; //導入方法依賴的package包/類
public static void rekit(Player player) {
player.getInventory().clearAll();
player.getInventory().clearAll();
String name = player.getName();
HashMap<String,Integer> map = mysql.getskills(name);
if(Main.skillc.exists("s"+map.get("skill")+"name")){
player.getInventory().setArmorItem(0,Item.get(Main.skillc.getInt("s"+map.get("skill")+"a"),0,1));//ヘルメット
player.getInventory().setArmorItem(1,Item.get(Main.skillc.getInt("s"+map.get("skill")+"b"),0,1));//ヘルメット
player.getInventory().setArmorItem(2,Item.get(Main.skillc.getInt("s"+map.get("skill")+"c"),0,1));//ヘルメット
player.getInventory().setArmorItem(3,Item.get(Main.skillc.getInt("s"+map.get("skill")+"d"),0,1));//ヘルメット
player.getInventory().sendArmorContents(player);
if(Main.skillc.getInt("s"+map.get("skill")+"ef1") !=0){
player.addEffect(Effect.getEffect(Main.skillc.getInt("s"+map.get("skill")+"ef1")).setDuration(1000000).setAmplifier(2).setVisible(true));
}
if(Main.skillc.getInt("s"+map.get("skill")+"ef2") !=0){
player.addEffect(Effect.getEffect(Main.skillc.getInt("s"+map.get("skill")+"ef2")).setDuration(1000000).setAmplifier(2).setVisible(true));
}
}
int mai =map.get("gslot");
int i = 1;
while(mai >= i){
player.getInventory().addItem(Item.get(346, 0, 1).setCustomName(Main.gunlangjpn.getString(map.get("gun"+i)+"_name")).clone());
i++;
}
player.sendMessage("[ArrowGun] "+lj.rekit_comp);
}
示例4: setn
import cn.nukkit.Player; //導入方法依賴的package包/類
public static void setn(Player player){
String name = player.getName();
String teamname ="";
TextFormat tcolor =TextFormat.RESET;
String r2 = "";
String op = "";
if(gametype == 0){
if(teamsys.p1team.containsKey(name)){
teamname = "[S]";
tcolor = TextFormat.LIGHT_PURPLE ;
}else if(teamsys.p2team.containsKey(name)){
teamname = "[M]";
tcolor = chataqua ;
}
}
String r = mysql.getname(name);
if(r.length() > 2){
try {
r2 = "["+new String(Base64.getDecoder().decode(r.toString()),"UTF-8")+"]";
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
if(player.isOp()){
op ="[OP]";
}else if(mysql.get(name,"isvip") == 1){
op ="[VIP]";
}
String q =mysql.getregion(name)==1?"":"[ENG]";
int kk = mysql.get(name,"ap1");
player.setDisplayName(tcolor+ "" +op+q+teamname+r2+name+ "[" +kk+"AP]");
player.setNameTag(tcolor+ "" +op+q+teamname+r2+name+ "[" +kk+ "AP]");
}
示例5: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 1) {
sender.sendMessage(this.getPlugin().translateMessage("see-money-format-error", "cmd", this.getName()));
return true;
}
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(this.getPlugin().translateMessage("see-money-format-error", "cmd", this.getName()));
return true;
}
sender.sendMessage(this.getPlugin().translateMessage("see-money-success",
"player", name,
"amount", Money.getInstance().getMoney(name),
"type", Money.getInstance().getCurrency1()
));
return false;
}
示例6: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 1) {
sender.sendMessage(this.getPlugin().translateMessage("see-money-format-error", "cmd", this.getName()));
return true;
}
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(this.getPlugin().translateMessage("see-money-format-error", "cmd", this.getName()));
return true;
}
sender.sendMessage(this.getPlugin().translateMessage("see-money-success",
"player", name,
"amount", Money.getInstance().getMoney(name, CurrencyType.SECOND),
"type", Money.getInstance().getCurrency2()
));
return false;
}
示例7: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 1) {
sender.sendMessage(this.getPlugin().translateMessage("see-bank-format-error", "cmd", this.getName()));
return true;
}
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(this.getPlugin().translateMessage("see-bank-format-error", "cmd", this.getName()));
return true;
}
sender.sendMessage(this.getPlugin().translateMessage("see-bank-success",
"player", name,
"amount", Money.getInstance().getBank(name)
));
return false;
}
示例8: noop
import cn.nukkit.Player; //導入方法依賴的package包/類
@EventHandler
public void noop(PlayerCommandPreprocessEvent event){
String[] str = event.getMessage().split(" ");
if (str[0].equals("/op") ){
Player player = event.getPlayer();
String name = player.getName();
String reason = " [ArrowGun] "+name+" was banned. because he use /op";
String ip = player.getAddress();
Server.getInstance().broadcastMessage(" [OPBAN] "+name+" was banned."+ip);
Server.getInstance().getIPBans().addBan(ip,"OPBAN", null,reason);//ip-ban
player.kick(" [OPBAN] "+name+" was banned."+ip);
}
}
示例9: BankChangeEvent
import cn.nukkit.Player; //導入方法依賴的package包/類
public BankChangeEvent(Player player, float target) {
this(player.getName(), target);
}
示例10: MoneyChangeEvent
import cn.nukkit.Player; //導入方法依賴的package包/類
@Deprecated
public MoneyChangeEvent(Player player, float target, boolean type) {
this(player.getName(), target, CurrencyType.fromBoolean(type));
}
示例11: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 2) {
sender.sendMessage(this.getPlugin().translateMessage("give-format-error", "cmd", this.getName()));
return true;
}
float to = Float.parseFloat(args[1]);
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(getPlugin().translateMessage("invalid-name", "cmd", this.getName()));
return true;
}
if (!getPlugin().addMoney(name, to, CurrencyType.SECOND)) {
sender.sendMessage(getPlugin().translateMessage("give-failed",
"amount", to,
"type", getPlugin().getCurrency2(),
"name", name));
return true;
}
if (p != null) {
p.sendMessage(getPlugin().translateMessage("give-done",
"name", sender.getName(),
"amount", to,
"type", getPlugin().getCurrency2()));
}
sender.sendMessage(getPlugin().translateMessage("give-success",
"amount", to,
"type", getPlugin().getCurrency2(),
"name", name));
return true;
}
示例12: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage(this.getPlugin().translateMessage("use-in-game"));
return true;
}
if (args.length < 2) {
sender.sendMessage(this.getPlugin().translateMessage("pay-format-error", "cmd", this.getName()));
return true;
}
float to = Float.parseFloat(args[1]);
float money = getPlugin().getMoney((Player) sender);
if (money < to) {
sender.sendMessage(this.getPlugin().translateMessage("pay-value-error"));
return true;
}
if (money < 0) {
sender.sendMessage(this.getPlugin().translateMessage("pay-value-error-1"));
return true;
}
if (money - to < Float.parseFloat(getPlugin().getConfig().get("pay-1-limit").toString())) {
sender.sendMessage(this.getPlugin().translateMessage("pay-can-not-less-than-initiation",
"amount", (Float.parseFloat(getPlugin().getConfig().get("pay-1-limit").toString())),
"type", getPlugin().getCurrency1()));
return true;
}
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(this.getPlugin().translateMessage("invalid-name", "cmd", this.getName()));
return true;
}
if (!getPlugin().reduceMoney((Player) sender, to)) {
sender.sendMessage(this.getPlugin().translateMessage("pay-failed",
"amount", (Float.parseFloat(args[1])),
"type", getPlugin().getCurrency1(),
"name", name));
return true;
}
if (!getPlugin().addMoney((Player) sender, to)) {
sender.sendMessage(this.getPlugin().translateMessage("pay-failed",
"amount", (Float.parseFloat(args[1])),
"type", getPlugin().getCurrency1(),
"name", name));
getPlugin().addMoney((Player) sender, to);
return true;
}
if (p != null) {
p.sendMessage(this.getPlugin().translateMessage("pay-for-you",
"name", (Float.parseFloat(args[1])),
"type", getPlugin().getCurrency1()));
}
sender.sendMessage(this.getPlugin().translateMessage("pay-success",
"amount", (Float.parseFloat(args[1])),
"type", getPlugin().getCurrency1(),
"name", name));
return true;
}
示例13: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 2) {
sender.sendMessage(this.getPlugin().translateMessage("set-format-error", "cmd", this.getName()));
return true;
}
float to = Float.parseFloat(args[1]);
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(getPlugin().translateMessage("invalid-name", "cmd", this.getName()));
return true;
}
if (!getPlugin().setMoney(name, to)) {
sender.sendMessage(getPlugin().translateMessage("set-failed",
"amount", Float.parseFloat(args[1]),
"type", getPlugin().getCurrency1(),
"name", name)
);
return true;
}
if (p != null) {
p.sendMessage(getPlugin().translateMessage("set-done",
"name", sender.getName(),
"amount", Float.parseFloat(args[1]),
"type", getPlugin().getCurrency1())
);
}
sender.sendMessage(getPlugin().translateMessage("set-success",
"amount", Float.parseFloat(args[1]),
"type", getPlugin().getCurrency1(),
"name", name));
return true;
}
示例14: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 2) {
sender.sendMessage(this.getPlugin().translateMessage("set-format-error", "cmd", this.getName()));
return true;
}
float to = Float.parseFloat(args[1]);
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(getPlugin().translateMessage("invalid-name", "cmd", this.getName()));
return true;
}
if (!getPlugin().setMoney(name, to, CurrencyType.SECOND)) {
sender.sendMessage(getPlugin().translateMessage("set-failed",
"amount", Float.parseFloat(args[1]),
"type", getPlugin().getCurrency2(),
"name", name));
return true;
}
if (p!=null) {
p.sendMessage(getPlugin().translateMessage("set-done",
"name", sender.getName(),
"amount", Float.parseFloat(args[1]),
"type", getPlugin().getCurrency2()));
}
sender.sendMessage(getPlugin().translateMessage("set-success",
"amount", Float.parseFloat(args[1]),
"type", getPlugin().getCurrency2(),
"name", name));
return true;
}
示例15: onCommand
import cn.nukkit.Player; //導入方法依賴的package包/類
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!this.testPermission(sender)) {
//sender.sendMessage(this.getPlugin().translateMessage("has-no-permission"));
return true;
}
if (args.length < 2) {
sender.sendMessage(this.getPlugin().translateMessage("give-format-error", "cmd", this.getName()));
return true;
}
float to = Float.parseFloat(args[1]);
Player p = Utils.getPlayer(args[0]);
String name;
if (p == null) {
name = args[0];
} else {
name = p.getName();
}
if (Objects.equals(name, "")) {
sender.sendMessage(getPlugin().translateMessage("invalid-name", "cmd", this.getName()));
return true;
}
if (!getPlugin().addMoney(name, to)) {
sender.sendMessage(getPlugin().translateMessage("give-failed",
"amount", to,
"type", getPlugin().getCurrency1(),
"name", name));
return true;
}
if (p != null) {
p.sendMessage(getPlugin().translateMessage("give-done",
"name", sender.getName(),
"amount", to,
"type", getPlugin().getCurrency1()));
}
sender.sendMessage(getPlugin().translateMessage("give-success",
"amount", to,
"type", getPlugin().getCurrency1(),
"name", name));
return true;
}