blob: 5a80710b1712d2a2de4fadd05f841b691bf74baa [file] [log] [blame] [raw]
package li.cil.oc.util
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.nbt.NBTTagCompound
object PlayerUtils {
def persistedData(player: EntityPlayer): NBTTagCompound = {
val nbt = player.getEntityData
if (!nbt.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) {
nbt.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound())
}
nbt.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG)
}
}