当前位置: 首页>>代码示例>>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;未经允许,请勿转载。