本文整理汇总了Java中net.minecraft.server.management.PlayerProfileCache.getProfileByUUID方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerProfileCache.getProfileByUUID方法的具体用法?Java PlayerProfileCache.getProfileByUUID怎么用?Java PlayerProfileCache.getProfileByUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.server.management.PlayerProfileCache
的用法示例。
在下文中一共展示了PlayerProfileCache.getProfileByUUID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetchNames
import net.minecraft.server.management.PlayerProfileCache; //导入方法依赖的package包/类
public static String[] fetchNames(UUID[] uuids)
{
PlayerProfileCache cache = WorldBorder.SERVER.getPlayerProfileCache();
String[] names = new String[uuids.length];
// Makes sure server reads from cache first
cache.load();
for (int i = 0; i < uuids.length; i++)
{
GameProfile profile = cache.getProfileByUUID(uuids[i]);
names[i] = (profile != null)
? profile.getName()
: "<unknown:" + uuids[i].toString() + ">";
}
return names;
}
示例2: readVillageDataFromNBT
import net.minecraft.server.management.PlayerProfileCache; //导入方法依赖的package包/类
/**
* Read this village's data from NBT.
*/
public void readVillageDataFromNBT(NBTTagCompound p_82690_1_)
{
this.numVillagers = p_82690_1_.getInteger("PopSize");
this.villageRadius = p_82690_1_.getInteger("Radius");
this.numIronGolems = p_82690_1_.getInteger("Golems");
this.lastAddDoorTimestamp = p_82690_1_.getInteger("Stable");
this.tickCounter = p_82690_1_.getInteger("Tick");
this.noBreedTicks = p_82690_1_.getInteger("MTick");
this.center = new BlockPos(p_82690_1_.getInteger("CX"), p_82690_1_.getInteger("CY"), p_82690_1_.getInteger("CZ"));
this.centerHelper = new BlockPos(p_82690_1_.getInteger("ACX"), p_82690_1_.getInteger("ACY"), p_82690_1_.getInteger("ACZ"));
NBTTagList nbttaglist = p_82690_1_.getTagList("Doors", 10);
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
VillageDoorInfo villagedoorinfo = new VillageDoorInfo(new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"), nbttagcompound.getInteger("Z")), nbttagcompound.getInteger("IDX"), nbttagcompound.getInteger("IDZ"), nbttagcompound.getInteger("TS"));
this.villageDoorInfoList.add(villagedoorinfo);
}
NBTTagList nbttaglist1 = p_82690_1_.getTagList("Players", 10);
for (int j = 0; j < nbttaglist1.tagCount(); ++j)
{
NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(j);
if (nbttagcompound1.hasKey("UUID"))
{
PlayerProfileCache playerprofilecache = MinecraftServer.getServer().getPlayerProfileCache();
GameProfile gameprofile = playerprofilecache.getProfileByUUID(UUID.fromString(nbttagcompound1.getString("UUID")));
if (gameprofile != null)
{
this.playerReputation.put(gameprofile.getName(), Integer.valueOf(nbttagcompound1.getInteger("S")));
}
}
else
{
this.playerReputation.put(nbttagcompound1.getString("Name"), Integer.valueOf(nbttagcompound1.getInteger("S")));
}
}
}
示例3: readVillageDataFromNBT
import net.minecraft.server.management.PlayerProfileCache; //导入方法依赖的package包/类
/**
* Read this village's data from NBT.
*/
public void readVillageDataFromNBT(NBTTagCompound compound)
{
this.numVillagers = compound.getInteger("PopSize");
this.villageRadius = compound.getInteger("Radius");
this.numIronGolems = compound.getInteger("Golems");
this.lastAddDoorTimestamp = compound.getInteger("Stable");
this.tickCounter = compound.getInteger("Tick");
this.noBreedTicks = compound.getInteger("MTick");
this.center = new BlockPos(compound.getInteger("CX"), compound.getInteger("CY"), compound.getInteger("CZ"));
this.centerHelper = new BlockPos(compound.getInteger("ACX"), compound.getInteger("ACY"), compound.getInteger("ACZ"));
NBTTagList nbttaglist = compound.getTagList("Doors", 10);
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
VillageDoorInfo villagedoorinfo = new VillageDoorInfo(new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"), nbttagcompound.getInteger("Z")), nbttagcompound.getInteger("IDX"), nbttagcompound.getInteger("IDZ"), nbttagcompound.getInteger("TS"));
this.villageDoorInfoList.add(villagedoorinfo);
}
NBTTagList nbttaglist1 = compound.getTagList("Players", 10);
for (int j = 0; j < nbttaglist1.tagCount(); ++j)
{
NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(j);
if (nbttagcompound1.hasKey("UUID") && this.worldObj != null && this.worldObj.getMinecraftServer() != null)
{
PlayerProfileCache playerprofilecache = this.worldObj.getMinecraftServer().getPlayerProfileCache();
GameProfile gameprofile = playerprofilecache.getProfileByUUID(UUID.fromString(nbttagcompound1.getString("UUID")));
if (gameprofile != null)
{
this.playerReputation.put(gameprofile.getName(), Integer.valueOf(nbttagcompound1.getInteger("S")));
}
}
else
{
this.playerReputation.put(nbttagcompound1.getString("Name"), Integer.valueOf(nbttagcompound1.getInteger("S")));
}
}
}