本文整理汇总了Java中org.spongepowered.api.entity.living.player.User.getName方法的典型用法代码示例。如果您正苦于以下问题:Java User.getName方法的具体用法?Java User.getName怎么用?Java User.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.spongepowered.api.entity.living.player.User
的用法示例。
在下文中一共展示了User.getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AddPlayer
import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public void AddPlayer(User p) {
String PlayerString = p.getUniqueId().toString();
if (!useUUIDs()){
PlayerString = p.getName();
}
stats.getNode(PlayerString,"PlayerName").setValue( p.getName());
stats.getNode(PlayerString,"JoinDate").setValue(RUUtil.DateNow());
stats.getNode(PlayerString,"LastVisist").setValue(RUUtil.DateNow());
stats.getNode(PlayerString,"TimePlayed").setValue(0);
}
示例2: addPlayerTime
import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public int addPlayerTime(User p, int ammount){
String PlayerString = p.getUniqueId().toString();
if (!useUUIDs()){
PlayerString = p.getName();
}
int time = stats.getNode(PlayerString,"TimePlayed").getInt();
stats.getNode(PlayerString,"TimePlayed").setValue(time+ammount);
return time+ammount;
}
示例3: setLastVisit
import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public void setLastVisit(User p){
String PlayerString = p.getUniqueId().toString();
if (!useUUIDs()){
PlayerString = p.getName();
}
stats.getNode(PlayerString,"LastVisist").setValue(RUUtil.DateNow());
}
示例4: getPlayerKey
import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public String getPlayerKey(User user){
if (useUUIDs() && stats.getNode(user.getUniqueId().toString(),"PlayerName").getString() != null){
return user.getUniqueId().toString();
} else if (!useUUIDs() && stats.getNode(user.getName(),"PlayerName").getString() != null){
return user.getName();
}
return null;
}
示例5: CachedPlayer
import org.spongepowered.api.entity.living.player.User; //导入方法依赖的package包/类
public CachedPlayer(User user) {
super(null);
this.uuid = UUID.fromString(user.getUniqueId().toString());
this.name = user.getName();
this.isOnline = false;
}