@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
if (nbt.hasKey("owner", Constants.NBT.TAG_STRING)) {
String ownerName = nbt.getString("owner");
this.owner = TileEntitySkull.updateGameprofile(new GameProfile(null, ownerName));
} else if (nbt.hasKey("OwnerUUID", Constants.NBT.TAG_STRING)) {
final String uuidStr = nbt.getString("OwnerUUID");
try {
UUID uuid = UUID.fromString(uuidStr);
this.owner = new GameProfile(uuid, null);
} catch (IllegalArgumentException e) {
Log.warn(e, "Failed to parse UUID: %s", uuidStr);
}
} else if (nbt.hasKey("Owner", Constants.NBT.TAG_COMPOUND)) {
this.owner = NBTUtil.readGameProfileFromNBT(nbt.getCompoundTag("Owner"));
}
}
TileEntityGoldenEgg.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:OpenBlocks
作者:
评论列表
文章目录