當前位置: 首頁>>代碼示例>>Java>>正文


Java Player.getName方法代碼示例

本文整理匯總了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);
}
 
開發者ID:organization,項目名稱:ShowDeath,代碼行數:12,代碼來源:DeathTag.java

示例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()
    );
}
 
開發者ID:MinecraftMarket,項目名稱:MinecraftMarket-Plugin,代碼行數:11,代碼來源:NukkitStats.java

示例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);

}
 
開發者ID:haniokasai,項目名稱:NuclearGunWars-plugin,代碼行數:28,代碼來源:gunsys.java

示例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]");
  }
 
開發者ID:haniokasai,項目名稱:NuclearGunWars-plugin,代碼行數:38,代碼來源:Main.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:33,代碼來源:SeeMoney1Command.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:33,代碼來源:SeeMoney2Command.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:32,代碼來源:SeeBankCommand.java

示例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);

}
  }
 
開發者ID:haniokasai,項目名稱:NuclearGunWars-plugin,代碼行數:15,代碼來源:Main.java

示例9: BankChangeEvent

import cn.nukkit.Player; //導入方法依賴的package包/類
public BankChangeEvent(Player player, float target) {
	this(player.getName(), target);
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:4,代碼來源:BankChangeEvent.java

示例10: MoneyChangeEvent

import cn.nukkit.Player; //導入方法依賴的package包/類
@Deprecated
public MoneyChangeEvent(Player player, float target, boolean type) {
	this(player.getName(), target, CurrencyType.fromBoolean(type));
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:5,代碼來源:MoneyChangeEvent.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:49,代碼來源:Give2Command.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:77,代碼來源:Pay1Command.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:50,代碼來源:Set1Command.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:48,代碼來源:Set2Command.java

示例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;
}
 
開發者ID:Him188,項目名稱:Money,代碼行數:50,代碼來源:Give1Command.java


注:本文中的cn.nukkit.Player.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。