MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / writeGameProfile

Method writeGameProfile

src/main/java/net/minecraft/nbt/NBTUtil.java:82–122  ·  view source on GitHub ↗

Writes a GameProfile to an NBTTagCompound. @param tagCompound The NBTTagCompound to write the GameProfile to. @param profile The game profile you are saving.

(NBTTagCompound tagCompound, GameProfile profile)

Source from the content-addressed store, hash-verified

80 * @param profile The game profile you are saving.
81 */
82 public static NBTTagCompound writeGameProfile(NBTTagCompound tagCompound, GameProfile profile)
83 {
84 if (!StringUtils.isNullOrEmpty(profile.getName()))
85 {
86 tagCompound.setString("Name", profile.getName());
87 }
88
89 if (profile.getId() != null)
90 {
91 tagCompound.setString("Id", profile.getId().toString());
92 }
93
94 if (!profile.getProperties().isEmpty())
95 {
96 NBTTagCompound nbttagcompound = new NBTTagCompound();
97
98 for (String s : profile.getProperties().keySet())
99 {
100 NBTTagList nbttaglist = new NBTTagList();
101
102 for (Property property : profile.getProperties().get(s))
103 {
104 NBTTagCompound nbttagcompound1 = new NBTTagCompound();
105 nbttagcompound1.setString("Value", property.getValue());
106
107 if (property.hasSignature())
108 {
109 nbttagcompound1.setString("Signature", property.getSignature());
110 }
111
112 nbttaglist.appendTag(nbttagcompound1);
113 }
114
115 nbttagcompound.setTag(s, nbttaglist);
116 }
117
118 tagCompound.setTag("Properties", nbttagcompound);
119 }
120
121 return tagCompound;
122 }
123
124 public static boolean func_181123_a(NBTBase p_181123_0_, NBTBase p_181123_1_, boolean p_181123_2_)
125 {

Callers 5

renderByItemMethod · 0.95
doRenderLayerMethod · 0.95
updateItemStackNBTMethod · 0.95
writeToNBTMethod · 0.95
breakBlockMethod · 0.95

Calls 12

isNullOrEmptyMethod · 0.95
setStringMethod · 0.95
appendTagMethod · 0.95
setTagMethod · 0.95
getNameMethod · 0.65
getIdMethod · 0.65
getPropertiesMethod · 0.65
getMethod · 0.65
getValueMethod · 0.65
toStringMethod · 0.45
isEmptyMethod · 0.45
keySetMethod · 0.45

Tested by

no test coverage detected